@Retention(value=CLASS) @Target(value=METHOD) public @interface TypeCheck
TypeSystem
. This is useful
for types where the guest language specific type check can be implemented more efficiently than
an instanceof check. The annotated method must be contained in a TypeSystem
annotated
class. Type checks must conform to the following signature:
public static boolean is{TypeName}(Object
value)
. The checked type must be a type declared in the TypeSystem
.
If no TypeCheck
is declared then the type system implicitly uses a type check that can be
declared as follows:
@TypeCheck(Type.class) public static boolean isType(Object value) { return value instanceof Type; }
TypeCast
public abstract Class<?> value