A collection of utility methods used to deal with traits.
| Modifiers | Name | Description |
|---|---|---|
static @interface |
Traits.Implemented |
Internal annotation used to indicate which methods in a trait interface have a default implementation. |
| Modifiers | Name | Description |
|---|---|---|
static ClassNode |
FORCEOVERRIDE_CLASSNODE |
|
static ClassNode |
IMPLEMENTED_CLASSNODE |
|
static Class |
TRAIT_CLASS |
|
static ClassNode |
TRAIT_CLASSNODE |
| Type | Name and description |
|---|---|
static boolean |
hasDefaultImplementation(MethodNode method)Indicates whether a method in a trait interface has a default implementation. |
static boolean |
isAnnotatedWithTrait(ClassNode cNode)Returns true if the specified class node is annotated with the Trait interface. |
static boolean |
isForceOverride(MethodNode methodNode)Returns true if the specified method node is annotated with ForceOverride |
static boolean |
isForceOverride(Method methodNode)Returns true if the specified method is annotated with ForceOverride |
static boolean |
isTrait(ClassNode cNode)Returns true if the specified class node is a trait. |
static boolean |
isTrait(Class clazz)Returns true if the specified class is a trait. |
Indicates whether a method in a trait interface has a default implementation.
method - a method nodeReturns true if the specified class node is annotated with the Trait interface.
cNode - a class nodeReturns true if the specified method node is annotated with ForceOverride
methodNode - a method nodeReturns true if the specified method is annotated with ForceOverride
methodNode - a method Returns true if the specified class node is a trait.
cNode - a class node to test Returns true if the specified class is a trait.
clazz - a class to test