Package org.aspectj.lang.reflect
Interface AjType<T>
-
- All Superinterfaces:
java.lang.reflect.AnnotatedElement,java.lang.reflect.Type
public interface AjType<T> extends java.lang.reflect.Type, java.lang.reflect.AnnotatedElementThe runtime representation of a type (Aspect, Class, Interface, Annotation, Enum, or Array) in an AspectJ program.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AdvicegetAdvice(java.lang.String name)Returns the advice with the given name.Advice[]getAdvice(AdviceKind... ofTypes)Returns all of the advice for this type, of an advice kind contained in the parameter list.AjType<?>[]getAjTypes()Returns an array containing all the public types that are members of this typejava.lang.reflect.ConstructorgetConstructor(AjType<?>... parameterTypes)Returns the constructor object for the specified public constructor of this typejava.lang.reflect.Constructor[]getConstructors()Returns all of the public constructors of this typeDeclareAnnotation[]getDeclareAnnotations()Return all of the declare annotation members of this type, including declare annotation members inherited from super-typesAdvicegetDeclaredAdvice(java.lang.String name)Returns the advice declared in this type with the given name.Advice[]getDeclaredAdvice(AdviceKind... ofTypes)Returns all of the advice declared by this type, of an advice kind contained in the parameter list.AjType<?>[]getDeclaredAjTypes()Returns an array containing all the types declared by this typejava.lang.reflect.ConstructorgetDeclaredConstructor(AjType<?>... parameterTypes)Returns the constructor object for the specified constructor of this typejava.lang.reflect.Constructor[]getDeclaredConstructors()Returns all the constructors declared in this typejava.lang.reflect.FieldgetDeclaredField(java.lang.String name)Return the field declared in this type with the given namejava.lang.reflect.Field[]getDeclaredFields()Returns all the fields declared in this typeInterTypeConstructorDeclarationgetDeclaredITDConstructor(AjType<?> target, AjType<?>... parameterTypes)Return the inter-type constructor declared by this type matching the given specificationInterTypeConstructorDeclaration[]getDeclaredITDConstructors()Returns all of the inter-type constructors declared by this typeInterTypeFieldDeclarationgetDeclaredITDField(java.lang.String name, AjType<?> target)Return the inter-type field declared in this type with the given specificationInterTypeFieldDeclaration[]getDeclaredITDFields()Return all of the inter-type fields declared in this typeInterTypeMethodDeclarationgetDeclaredITDMethod(java.lang.String name, AjType<?> target, AjType<?>... parameterTypes)Return the inter-type method declared by this type matching the given specificationInterTypeMethodDeclaration[]getDeclaredITDMethods()Return all of the inter-type methods declared by this typejava.lang.reflect.MethodgetDeclaredMethod(java.lang.String name, AjType<?>... parameterTypes)Return the method object for the specified method declared in this typejava.lang.reflect.Method[]getDeclaredMethods()Return all the methods declared by this typePointcutgetDeclaredPointcut(java.lang.String name)Return the pointcut object representing the specified pointcut declared by this typePointcut[]getDeclaredPointcuts()Returns all of the pointcuts declared by this typeDeclareErrorOrWarning[]getDeclareErrorOrWarnings()Returns all of the declare error and declare warning members of this type, including declare error/warning members inherited from super-typesDeclareParents[]getDeclareParents()Returns all of the declare parents members of this type, including declare parent members inherited from super-typesDeclarePrecedence[]getDeclarePrecedence()Return all of the declare precedence members of this type, including declare precedence members inherited from super-typesDeclareSoft[]getDeclareSofts()Return all of the declare soft members of this type, including declare soft members inherited from super-typesAjType<?>getDeclaringType()If this type is a member of another type, return the AjType representing the type in which it was declared.java.lang.reflect.ConstructorgetEnclosingConstructor()If this type represents a local or anonymous type declared within a constructor, return then enclosing Method object.java.lang.reflect.MethodgetEnclosingMethod()If this type represents a local or anonymous type declared within a method, return then enclosing Method object.AjType<?>getEnclosingType()Returns the immediately enclosing type of this type.T[]getEnumConstants()Returns the elements of this enum class, or null if this type does not represent an enum type.java.lang.reflect.FieldgetField(java.lang.String name)Return the public field with the given namejava.lang.reflect.Field[]getFields()Return the public fields declared by this typejava.lang.reflect.TypegetGenericSupertype()The generic supertype of this type, as defined by Class.getGenericSupertypeAjType<?>[]getInterfaces()The interfaces implemented by this typeInterTypeConstructorDeclarationgetITDConstructor(AjType<?> target, AjType<?>... parameterTypes)Return the public inter-type constructor matching the given specificationInterTypeConstructorDeclaration[]getITDConstructors()Return all of the public inter-type constructors of this typeInterTypeFieldDeclarationgetITDField(java.lang.String name, AjType<?> target)Return the public inter-type field matching the given specificationInterTypeFieldDeclaration[]getITDFields()Return all of the public inter-type fields for this typeInterTypeMethodDeclarationgetITDMethod(java.lang.String name, AjType<?> target, AjType<?>... parameterTypes)Return the public inter-type method of this type matching the given specificationInterTypeMethodDeclaration[]getITDMethods()Return all of the public inter-type declared methods of this typejava.lang.Class<T>getJavaClass()The java.lang.Class that corresponds to this AjTypejava.lang.reflect.MethodgetMethod(java.lang.String name, AjType<?>... parameterTypes)Return the method object for the specified public method declared in this typejava.lang.reflect.Method[]getMethods()Returns all the public methods of this typeintgetModifiers()The modifiers declared for this type.java.lang.StringgetName()The name of this type, in the same format as returned by Class.getName()java.lang.PackagegetPackage()The package in which this type is declaredPerClausegetPerClause()If this type represents an aspect, returns the associated per-clause.PointcutgetPointcut(java.lang.String name)Return the pointcut object representing the specified public pointcutPointcut[]getPointcuts()Returns all of the public pointcuts of this typeAjType<?>getSupertype()The supertype of this type.java.lang.reflect.TypeVariable<java.lang.Class<T>>[]getTypeParameters()Returns an array of TypeVariable objects that represent the type variables declared by this type (if any)booleanisArray()Return true if this is an array typebooleanisAspect()Return true if this is an aspect typebooleanisEnum()True if this is an enum typebooleanisInstance(java.lang.Object o)True if the given object is assignment-compatible with an object of the type represented by this AjTypebooleanisInterface()True if this is an interface typebooleanisLocalClass()Returns true if and only if the underlying type is a local classbooleanisMemberAspect()Returns true if and only if the underlying type is a member aspectbooleanisMemberClass()Returns true if and only if the underlying type is a member classbooleanisPrimitive()Return true if this object represents a primitive typebooleanisPrivileged()Returns true if and only if the underlying type is a privileged aspect
-
-
-
Method Detail
-
getName
java.lang.String getName()
The name of this type, in the same format as returned by Class.getName()
-
getPackage
java.lang.Package getPackage()
The package in which this type is declared
-
getInterfaces
AjType<?>[] getInterfaces()
The interfaces implemented by this type
-
getModifiers
int getModifiers()
The modifiers declared for this type. The return value can be interpreted using java.lang.reflect.Modifier
-
getJavaClass
java.lang.Class<T> getJavaClass()
The java.lang.Class that corresponds to this AjType
-
getSupertype
AjType<?> getSupertype()
The supertype of this type. If this type represents Object or a primitive type then null is returned.
-
getGenericSupertype
java.lang.reflect.Type getGenericSupertype()
The generic supertype of this type, as defined by Class.getGenericSupertype
-
getEnclosingMethod
java.lang.reflect.Method getEnclosingMethod()
If this type represents a local or anonymous type declared within a method, return then enclosing Method object.
-
getEnclosingConstructor
java.lang.reflect.Constructor getEnclosingConstructor()
If this type represents a local or anonymous type declared within a constructor, return then enclosing Method object.
-
getEnclosingType
AjType<?> getEnclosingType()
Returns the immediately enclosing type of this type.
-
getDeclaringType
AjType<?> getDeclaringType()
If this type is a member of another type, return the AjType representing the type in which it was declared.
-
getPerClause
PerClause getPerClause()
If this type represents an aspect, returns the associated per-clause. Returns null for non-aspect types.
-
getAjTypes
AjType<?>[] getAjTypes()
Returns an array containing all the public types that are members of this type
-
getDeclaredAjTypes
AjType<?>[] getDeclaredAjTypes()
Returns an array containing all the types declared by this type
-
getConstructor
java.lang.reflect.Constructor getConstructor(AjType<?>... parameterTypes) throws java.lang.NoSuchMethodException
Returns the constructor object for the specified public constructor of this type- Throws:
java.lang.NoSuchMethodException
-
getConstructors
java.lang.reflect.Constructor[] getConstructors()
Returns all of the public constructors of this type
-
getDeclaredConstructor
java.lang.reflect.Constructor getDeclaredConstructor(AjType<?>... parameterTypes) throws java.lang.NoSuchMethodException
Returns the constructor object for the specified constructor of this type- Throws:
java.lang.NoSuchMethodException
-
getDeclaredConstructors
java.lang.reflect.Constructor[] getDeclaredConstructors()
Returns all the constructors declared in this type
-
getDeclaredField
java.lang.reflect.Field getDeclaredField(java.lang.String name) throws java.lang.NoSuchFieldExceptionReturn the field declared in this type with the given name- Throws:
java.lang.NoSuchFieldException
-
getDeclaredFields
java.lang.reflect.Field[] getDeclaredFields()
Returns all the fields declared in this type
-
getField
java.lang.reflect.Field getField(java.lang.String name) throws java.lang.NoSuchFieldExceptionReturn the public field with the given name- Throws:
java.lang.NoSuchFieldException
-
getFields
java.lang.reflect.Field[] getFields()
Return the public fields declared by this type
-
getDeclaredMethod
java.lang.reflect.Method getDeclaredMethod(java.lang.String name, AjType<?>... parameterTypes) throws java.lang.NoSuchMethodExceptionReturn the method object for the specified method declared in this type- Throws:
java.lang.NoSuchMethodException
-
getMethod
java.lang.reflect.Method getMethod(java.lang.String name, AjType<?>... parameterTypes) throws java.lang.NoSuchMethodExceptionReturn the method object for the specified public method declared in this type- Throws:
java.lang.NoSuchMethodException
-
getDeclaredMethods
java.lang.reflect.Method[] getDeclaredMethods()
Return all the methods declared by this type
-
getMethods
java.lang.reflect.Method[] getMethods()
Returns all the public methods of this type
-
getDeclaredPointcut
Pointcut getDeclaredPointcut(java.lang.String name) throws NoSuchPointcutException
Return the pointcut object representing the specified pointcut declared by this type- Throws:
NoSuchPointcutException
-
getPointcut
Pointcut getPointcut(java.lang.String name) throws NoSuchPointcutException
Return the pointcut object representing the specified public pointcut- Throws:
NoSuchPointcutException
-
getDeclaredPointcuts
Pointcut[] getDeclaredPointcuts()
Returns all of the pointcuts declared by this type
-
getPointcuts
Pointcut[] getPointcuts()
Returns all of the public pointcuts of this type
-
getDeclaredAdvice
Advice[] getDeclaredAdvice(AdviceKind... ofTypes)
Returns all of the advice declared by this type, of an advice kind contained in the parameter list.
-
getAdvice
Advice[] getAdvice(AdviceKind... ofTypes)
Returns all of the advice for this type, of an advice kind contained in the parameter list.
-
getAdvice
Advice getAdvice(java.lang.String name) throws NoSuchAdviceException
Returns the advice with the given name. For an @AspectJ declared advice member, this is the name of the annotated method. For a code-style advice declaration, this is the name given in the @AdviceName annotation if present.- Throws:
NoSuchAdviceException
-
getDeclaredAdvice
Advice getDeclaredAdvice(java.lang.String name) throws NoSuchAdviceException
Returns the advice declared in this type with the given name. For an @AspectJ declared advice member, this is the name of the annotated method. For a code-style advice declaration, this is the name given in the @AdviceName annotation if present.- Throws:
NoSuchAdviceException
-
getDeclaredITDMethod
InterTypeMethodDeclaration getDeclaredITDMethod(java.lang.String name, AjType<?> target, AjType<?>... parameterTypes) throws java.lang.NoSuchMethodException
Return the inter-type method declared by this type matching the given specification- Throws:
java.lang.NoSuchMethodException
-
getDeclaredITDMethods
InterTypeMethodDeclaration[] getDeclaredITDMethods()
Return all of the inter-type methods declared by this type
-
getITDMethod
InterTypeMethodDeclaration getITDMethod(java.lang.String name, AjType<?> target, AjType<?>... parameterTypes) throws java.lang.NoSuchMethodException
Return the public inter-type method of this type matching the given specification- Throws:
java.lang.NoSuchMethodException
-
getITDMethods
InterTypeMethodDeclaration[] getITDMethods()
Return all of the public inter-type declared methods of this type
-
getDeclaredITDConstructor
InterTypeConstructorDeclaration getDeclaredITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws java.lang.NoSuchMethodException
Return the inter-type constructor declared by this type matching the given specification- Throws:
java.lang.NoSuchMethodException
-
getDeclaredITDConstructors
InterTypeConstructorDeclaration[] getDeclaredITDConstructors()
Returns all of the inter-type constructors declared by this type
-
getITDConstructor
InterTypeConstructorDeclaration getITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws java.lang.NoSuchMethodException
Return the public inter-type constructor matching the given specification- Throws:
java.lang.NoSuchMethodException
-
getITDConstructors
InterTypeConstructorDeclaration[] getITDConstructors()
Return all of the public inter-type constructors of this type
-
getDeclaredITDField
InterTypeFieldDeclaration getDeclaredITDField(java.lang.String name, AjType<?> target) throws java.lang.NoSuchFieldException
Return the inter-type field declared in this type with the given specification- Throws:
java.lang.NoSuchFieldException
-
getDeclaredITDFields
InterTypeFieldDeclaration[] getDeclaredITDFields()
Return all of the inter-type fields declared in this type
-
getITDField
InterTypeFieldDeclaration getITDField(java.lang.String name, AjType<?> target) throws java.lang.NoSuchFieldException
Return the public inter-type field matching the given specification- Throws:
java.lang.NoSuchFieldException
-
getITDFields
InterTypeFieldDeclaration[] getITDFields()
Return all of the public inter-type fields for this type
-
getDeclareErrorOrWarnings
DeclareErrorOrWarning[] getDeclareErrorOrWarnings()
Returns all of the declare error and declare warning members of this type, including declare error/warning members inherited from super-types
-
getDeclareParents
DeclareParents[] getDeclareParents()
Returns all of the declare parents members of this type, including declare parent members inherited from super-types
-
getDeclareSofts
DeclareSoft[] getDeclareSofts()
Return all of the declare soft members of this type, including declare soft members inherited from super-types
-
getDeclareAnnotations
DeclareAnnotation[] getDeclareAnnotations()
Return all of the declare annotation members of this type, including declare annotation members inherited from super-types
-
getDeclarePrecedence
DeclarePrecedence[] getDeclarePrecedence()
Return all of the declare precedence members of this type, including declare precedence members inherited from super-types
-
getEnumConstants
T[] getEnumConstants()
Returns the elements of this enum class, or null if this type does not represent an enum type.
-
getTypeParameters
java.lang.reflect.TypeVariable<java.lang.Class<T>>[] getTypeParameters()
Returns an array of TypeVariable objects that represent the type variables declared by this type (if any)
-
isEnum
boolean isEnum()
True if this is an enum type
-
isInstance
boolean isInstance(java.lang.Object o)
True if the given object is assignment-compatible with an object of the type represented by this AjType
-
isInterface
boolean isInterface()
True if this is an interface type
-
isLocalClass
boolean isLocalClass()
Returns true if and only if the underlying type is a local class
-
isMemberClass
boolean isMemberClass()
Returns true if and only if the underlying type is a member class
-
isArray
boolean isArray()
Return true if this is an array type
-
isPrimitive
boolean isPrimitive()
Return true if this object represents a primitive type
-
isAspect
boolean isAspect()
Return true if this is an aspect type
-
isMemberAspect
boolean isMemberAspect()
Returns true if and only if the underlying type is a member aspect
-
isPrivileged
boolean isPrivileged()
Returns true if and only if the underlying type is a privileged aspect
-
-