Package bridge
Class Invocation
java.lang.Object
bridge.Invocation
A class that can be used to access field & method bridges (and other things too)
- Notes:
- Invocations must be constructed and completed in a single statement. Partial invocations may not be stored.
Usages of these constructors are counted as
invocations
. Usages ofLANGUAGE_LEVEL
may generateforks
.
-
Nested Class Summary
Modifier and TypeClassDescriptionfinal class
A class that is used to build field invocationsfinal class
A class that is used to build method invocations -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Creates fork(s) of your class with code tailored to the specified Java language level(s) -
Constructor Summary
ConstructorDescriptionInvocation
(Class<?> type) Starts a direct reference to something staticInvocation
(Class<?> type, Object instance) Starts a direct reference to something that belongs to an instance of an objectInvocation
(Object instance) Starts a direct reference to something that belongs to an instance of an objectInvocation
(String type) Starts a direct reference to something staticInvocation
(String type, Object instance) Starts a direct reference to something that belongs to an instance of an object -
Method Summary
Modifier and TypeMethodDescriptionClass<?>
Creates a direct reference to a classCreates a direct reference to a constructorCreates a direct reference to a fieldCreates a direct reference to a fieldCreates a direct reference to a fieldboolean
ofInstanceOf
(Class<?> type) Creates a direct type-compatibility checkboolean
ofInstanceOf
(String type) Creates a direct type-compatibility checkCreates a direct reference to a methodCreates a direct reference to a methodCreates a direct reference to a method
-
Field Details
-
LANGUAGE_LEVEL
public static final int LANGUAGE_LEVELCreates fork(s) of your class with code tailored to the specified Java language level(s)- Notes:
- This constant may only appear in integer comparisons as the first operand. Using it anywhere else will not compile correctly.
-
-
Constructor Details
-
Invocation
Starts a direct reference to something static- Parameters:
type
- Type constant – no dynamic values are permitted here.
-
Invocation
Starts a direct reference to something static- Parameters:
type
- Type name constant – no dynamic values or string manipulation is permitted here.- Throws:
NoClassDefFoundError
- When no type with the provided name can be resolved.
-
Invocation
Starts a direct reference to something that belongs to an instance of an object- Parameters:
instance
- Object instance- Notes:
- Calling this overload will cause the object type to be determined automatically.
-
Invocation
Starts a direct reference to something that belongs to an instance of an object- Parameters:
type
- Type constant – no dynamic values are permitted here.instance
- Object instance- Throws:
ClassCastException
- When the instance is not convertible to the provided type.
-
Invocation
Starts a direct reference to something that belongs to an instance of an object- Parameters:
type
- Type name constant – no dynamic values or string manipulation is permitted here.instance
- Object instance- Throws:
NoClassDefFoundError
- When no type with the provided name can be resolved.ClassCastException
- When the instance is not convertible to the provided type.
-
-
Method Details
-
ofClassLiteral
Creates a direct reference to a class- Returns:
- The real class reference.
- Throws:
NullPointerException
- When resolving the class of an instance and the instance isnull
.
-
ofInstanceOf
Creates a direct type-compatibility check- Parameters:
type
- Type constant – no dynamic values are permitted here.- Returns:
- The real boolean response.
-
ofInstanceOf
Creates a direct type-compatibility check- Parameters:
type
- Type name constant – no dynamic values or string manipulation is permitted here.- Returns:
- The real boolean response.
- Throws:
NoClassDefFoundError
- When no type with the provided name can be resolved.
-
ofConstructor
Creates a direct reference to a constructor- Returns:
- An imaginary reference for you to execute your request with.
- Notes:
- This operation requires static context.
-
ofMethod
Creates a direct reference to a method- Parameters:
name
- Method name constant – no dynamic values or string manipulation is permitted here.- Returns:
- An imaginary reference for you to execute your request with.
- Notes:
- Calling this overload will cause the method return type to be determined automatically.
-
ofMethod
Creates a direct reference to a method- Parameters:
type
- Method return type constant – no dynamic values are permitted here.name
- Method name constant – no dynamic values or string manipulation is permitted here.- Returns:
- An imaginary reference for you to execute your request with.
-
ofMethod
Creates a direct reference to a method- Parameters:
type
- Method return type name constant – no dynamic values or string manipulation is permitted here.name
- Method name constant – no dynamic values or string manipulation is permitted here.- Returns:
- An imaginary reference for you to execute your request with.
- Throws:
NoClassDefFoundError
- When no type with the provided name can be resolved.
-
ofField
Creates a direct reference to a field- Parameters:
name
- Field name constant – no dynamic values or string manipulation is permitted here.- Returns:
- An imaginary reference for you to execute your request with.
- Notes:
- Calling this overload will cause the field type to be determined automatically.
-
ofField
Creates a direct reference to a field- Parameters:
type
- Field type constant – no dynamic values are permitted here.name
- Field name constant – no dynamic values or string manipulation is permitted here.- Returns:
- An imaginary reference for you to execute your request with.
-
ofField
Creates a direct reference to a field- Parameters:
type
- Field type name constant – no dynamic values or string manipulation is permitted here.name
- Field name constant – no dynamic values or string manipulation is permitted here.- Returns:
- An imaginary reference for you to execute your request with.
- Throws:
NoClassDefFoundError
- When no type with the provided name can be resolved.
-