Class AjTypeImpl<T>
java.lang.Object
org.aspectj.internal.lang.reflect.AjTypeImpl<T>
- All Implemented Interfaces:
AnnotatedElement,Type,AjType<T>
- Author:
- colyer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanFor an annotation style advice member, this is the name of the annotated method.Advice[]getAdvice(AdviceKind... ofType)AjType<?>[]<A extends Annotation>
AgetAnnotation(Class<A> annotationType)getConstructor(AjType<?>... parameterTypes)getDeclaredAdvice(String name)For an annotation style advice member, this is the name of the annotated method.Advice[]getDeclaredAdvice(AdviceKind... ofType)AjType<?>[]getDeclaredConstructor(AjType<?>... parameterTypes)getDeclaredField(String name)Field[]getDeclaredITDConstructor(AjType<?> target, AjType<?>... parameterTypes)getDeclaredITDField(String name, AjType<?> target)getDeclaredITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes)getDeclaredMethod(String name, AjType<?>... parameterTypes)Method[]getDeclaredPointcut(String name)Pointcut[]AjType<?>AjType<?>T[]Field[]AjType<?>[]getITDConstructor(AjType<?> target, AjType<?>... parameterTypes)getITDField(String name, AjType<?> target)getITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes)Method[]intgetName()getPointcut(String name)Pointcut[]TypeVariable<Class<T>>[]inthashCode()booleanisAnnotationPresent(Class<? extends Annotation> annotationType)booleanisArray()booleanisAspect()booleanisEnum()booleanisInstance(Object o)booleanbooleanbooleanbooleanbooleanbooleantoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.reflect.AnnotatedElement
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByTypeMethods inherited from interface java.lang.reflect.Type
getTypeName
-
Constructor Details
-
AjTypeImpl
-
-
Method Details
-
getName
-
getPackage
- Specified by:
getPackagein interfaceAjType<T>- Returns:
- the package in which this type is declared
-
getInterfaces
- Specified by:
getInterfacesin interfaceAjType<T>- Returns:
- the interfaces implemented by this type
-
getModifiers
public int getModifiers()- Specified by:
getModifiersin interfaceAjType<T>- Returns:
- the modifiers declared for this type. The return value can be interpreted using java.lang.reflect.Modifier
-
getJavaClass
- Specified by:
getJavaClassin interfaceAjType<T>- Returns:
- the java.lang.Class that corresponds to this AjType
-
getSupertype
- Specified by:
getSupertypein interfaceAjType<T>- Returns:
- the supertype of this type. If this type represents Object or a primitive type then null is returned.
-
getGenericSupertype
- Specified by:
getGenericSupertypein interfaceAjType<T>- Returns:
- the generic supertype of this type, as defined by Class.getGenericSupertype
-
getEnclosingMethod
- Specified by:
getEnclosingMethodin interfaceAjType<T>- Returns:
- the enclosing Method if this type represents a local or anonymous type declared within a method
-
getEnclosingConstructor
- Specified by:
getEnclosingConstructorin interfaceAjType<T>- Returns:
- the enclosing Method if this type represents a local or anonymous type declared within a constructor
-
getEnclosingType
- Specified by:
getEnclosingTypein interfaceAjType<T>- Returns:
- the immediately enclosing type of this type.
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceAjType<T>- Returns:
- the AjType representing the typei n which it was declared (if this type is a member of another type)
-
getPerClause
- Specified by:
getPerClausein interfaceAjType<T>- Returns:
- the per-clause if this is an aspect, otherwise null
-
isAnnotationPresent
- Specified by:
isAnnotationPresentin interfaceAnnotatedElement
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedElement
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatedElement
-
getDeclaredAnnotations
- Specified by:
getDeclaredAnnotationsin interfaceAnnotatedElement
-
getAjTypes
- Specified by:
getAjTypesin interfaceAjType<T>- Returns:
- an array containing all the public types that are members of this type
-
getDeclaredAjTypes
- Specified by:
getDeclaredAjTypesin interfaceAjType<T>- Returns:
- an array containing all the types declared by this type
-
getConstructor
- Specified by:
getConstructorin interfaceAjType<T>- Parameters:
parameterTypes- the types of the constructor parameters- Returns:
- the constructor object for the specified public constructor of this type
- Throws:
NoSuchMethodException- if constructor not found
-
getConstructors
- Specified by:
getConstructorsin interfaceAjType<T>- Returns:
- all of the public constructors of this type
-
getDeclaredConstructor
public Constructor getDeclaredConstructor(AjType<?>... parameterTypes) throws NoSuchMethodException- Specified by:
getDeclaredConstructorin interfaceAjType<T>- Parameters:
parameterTypes- the types of the constructor parameters- Returns:
- the constructor object for the specified constructor of this type
- Throws:
NoSuchMethodException- if constructor not found
-
getDeclaredConstructors
- Specified by:
getDeclaredConstructorsin interfaceAjType<T>- Returns:
- all the constructors declared in this type
-
getDeclaredField
- Specified by:
getDeclaredFieldin interfaceAjType<T>- Parameters:
name- the field name- Returns:
- the declared field
- Throws:
NoSuchFieldException- if no field of that name is found
-
getDeclaredFields
- Specified by:
getDeclaredFieldsin interfaceAjType<T>- Returns:
- all the fields declared in this type
-
getField
- Specified by:
getFieldin interfaceAjType<T>- Parameters:
name- the field name- Returns:
- the public field with the given name
- Throws:
NoSuchFieldException- if field not found
-
getFields
-
getDeclaredMethod
public Method getDeclaredMethod(String name, AjType<?>... parameterTypes) throws NoSuchMethodException- Specified by:
getDeclaredMethodin interfaceAjType<T>- Parameters:
name- the method nameparameterTypes- the types of the method parameters- Returns:
- the method object for the specified method declared in this type
- Throws:
NoSuchMethodException- if the method cannot be found
-
getMethod
- Specified by:
getMethodin interfaceAjType<T>- Parameters:
name- the method nameparameterTypes- the types of the method parameters- Returns:
- the method object for the specified public method declared in this type
- Throws:
NoSuchMethodException- if the method cannot be found
-
getDeclaredMethods
- Specified by:
getDeclaredMethodsin interfaceAjType<T>- Returns:
- all the methods declared by this type
-
getMethods
- Specified by:
getMethodsin interfaceAjType<T>- Returns:
- all the public methods of this type
-
getDeclaredPointcut
- Specified by:
getDeclaredPointcutin interfaceAjType<T>- Parameters:
name- the pointcut name- Returns:
- the pointcut object representing the specified pointcut declared by this type
- Throws:
NoSuchPointcutException- if no pointcut of that name can be found
-
getPointcut
- Specified by:
getPointcutin interfaceAjType<T>- Parameters:
name- the pointcut name- Returns:
- the pointcut object representing the specified public pointcut
- Throws:
NoSuchPointcutException- if no pointcut of that name can be found
-
getDeclaredPointcuts
- Specified by:
getDeclaredPointcutsin interfaceAjType<T>- Returns:
- all of the pointcuts declared by this type
-
getPointcuts
- Specified by:
getPointcutsin interfaceAjType<T>- Returns:
- all of the public pointcuts of this type
-
getDeclaredAdvice
- Specified by:
getDeclaredAdvicein interfaceAjType<T>- Parameters:
ofType- theAdviceKinds of interest- Returns:
- all of the advice declared by this type, of an advice kind contained in the parameter list.
-
getAdvice
- Specified by:
getAdvicein interfaceAjType<T>- Parameters:
ofType- theAdviceKinds of interest- Returns:
- all of the advice for this type, of an advice kind contained in the parameter list.
-
getAdvice
Description copied from interface:AjTypeFor an annotation style 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.- Specified by:
getAdvicein interfaceAjType<T>- Parameters:
name- the advice name- Returns:
- the advice with the given name.
- Throws:
NoSuchAdviceException- if no advice can be found with that name
-
getDeclaredAdvice
Description copied from interface:AjTypeFor an annotation style 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.- Specified by:
getDeclaredAdvicein interfaceAjType<T>- Parameters:
name- the advice name- Returns:
- the advice declared in this type with the given name.
- Throws:
NoSuchAdviceException- if no advice can be found with that name
-
getDeclaredITDMethod
public InterTypeMethodDeclaration getDeclaredITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException- Specified by:
getDeclaredITDMethodin interfaceAjType<T>- Parameters:
name- the method nametarget- the target of the inter-type declarationparameterTypes- the types of the inter-type method declaration- Returns:
- the inter-type method declared by this type matching the given specification
- Throws:
NoSuchMethodException- if the inter-type declaration cannot be found
-
getDeclaredITDMethods
- Specified by:
getDeclaredITDMethodsin interfaceAjType<T>- Returns:
- all of the inter-type methods declared by this type
-
getITDMethod
public InterTypeMethodDeclaration getITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException- Specified by:
getITDMethodin interfaceAjType<T>- Parameters:
name- the method nametarget- the target of the inter-type declarationparameterTypes- the types of the inter-type method declaration- Returns:
- the public inter-type method of this type matching the given specification
- Throws:
NoSuchMethodException- if the inter-type declaration cannot be found
-
getITDMethods
- Specified by:
getITDMethodsin interfaceAjType<T>- Returns:
- all of the public inter-type declared methods of this type
-
getDeclaredITDConstructor
public InterTypeConstructorDeclaration getDeclaredITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException- Specified by:
getDeclaredITDConstructorin interfaceAjType<T>- Parameters:
target- the target of the inter-type constructor of interestparameterTypes- the types of the parameter of the inter-type constructor of interest- Returns:
- the inter-type constructor declared by this type matching the given specification
- Throws:
NoSuchMethodException- if the inter-type declaration cannot be found
-
getDeclaredITDConstructors
- Specified by:
getDeclaredITDConstructorsin interfaceAjType<T>- Returns:
- all of the inter-type constructors declared by this type
-
getITDConstructor
public InterTypeConstructorDeclaration getITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException- Specified by:
getITDConstructorin interfaceAjType<T>- Parameters:
target- the target of the inter-type constructor of interestparameterTypes- the types of the parameter of the inter-type constructor of interest- Returns:
- the public inter-type constructor matching the given specification
- Throws:
NoSuchMethodException- if the inter-type declaration cannot be found
-
getITDConstructors
- Specified by:
getITDConstructorsin interfaceAjType<T>- Returns:
- all of the public inter-type constructors of this type
-
getDeclaredITDField
public InterTypeFieldDeclaration getDeclaredITDField(String name, AjType<?> target) throws NoSuchFieldException- Specified by:
getDeclaredITDFieldin interfaceAjType<T>- Parameters:
name- the field nametarget- the target type for the inter-type declaration- Returns:
- the inter-type field declared in this type with the given specification
- Throws:
NoSuchFieldException- if the inter-type declaration cannot be found
-
getDeclaredITDFields
- Specified by:
getDeclaredITDFieldsin interfaceAjType<T>- Returns:
- all of the inter-type fields declared in this type
-
getITDField
public InterTypeFieldDeclaration getITDField(String name, AjType<?> target) throws NoSuchFieldException- Specified by:
getITDFieldin interfaceAjType<T>- Parameters:
name- the field nametarget- the target type for the inter-type declaration- Returns:
- the public inter-type field matching the given specification
- Throws:
NoSuchFieldException- if the inter-type declaration cannot be found
-
getITDFields
- Specified by:
getITDFieldsin interfaceAjType<T>- Returns:
- all of the public inter-type fields for this type
-
getDeclareErrorOrWarnings
- Specified by:
getDeclareErrorOrWarningsin interfaceAjType<T>- Returns:
- all of the declare error and declare warning members of this type, including declare error/warning members inherited from super-types
-
getDeclareParents
- Specified by:
getDeclareParentsin interfaceAjType<T>- Returns:
- all of the declare parents members of this type, including declare parent members inherited from super-types
-
getDeclareSofts
- Specified by:
getDeclareSoftsin interfaceAjType<T>- Returns:
- all of the declare soft members of this type, including declare soft members inherited from super-types
-
getDeclareAnnotations
- Specified by:
getDeclareAnnotationsin interfaceAjType<T>- Returns:
- all of the declare annotation members of this type, including declare annotation members inherited from super-types
-
getDeclarePrecedence
- Specified by:
getDeclarePrecedencein interfaceAjType<T>- Returns:
- all of the declare precedence members of this type, including declare precedence members inherited from super-types
-
getEnumConstants
- Specified by:
getEnumConstantsin interfaceAjType<T>- Returns:
- the elements of this enum class, or null if this type does not represent an enum type.
-
getTypeParameters
- Specified by:
getTypeParametersin interfaceAjType<T>- Returns:
- an array of TypeVariable objects that represent the type variables declared by this type (if any)
-
isEnum
public boolean isEnum() -
isInstance
- Specified by:
isInstancein interfaceAjType<T>- Parameters:
o- the object to check for assignment compatibility- Returns:
- true if the given object is assignment-compatible with an object of the type represented by this AjType
-
isInterface
public boolean isInterface()- Specified by:
isInterfacein interfaceAjType<T>- Returns:
- true if this is an interface type
-
isLocalClass
public boolean isLocalClass()- Specified by:
isLocalClassin interfaceAjType<T>- Returns:
- true if and only if the underlying type is a local class
-
isMemberClass
public boolean isMemberClass()- Specified by:
isMemberClassin interfaceAjType<T>- Returns:
- true if and only if the underlying type is a member class
-
isArray
public boolean isArray() -
isPrimitive
public boolean isPrimitive()- Specified by:
isPrimitivein interfaceAjType<T>- Returns:
- true if this object represents a primitive type
-
isAspect
public boolean isAspect() -
isMemberAspect
public boolean isMemberAspect()- Specified by:
isMemberAspectin interfaceAjType<T>- Returns:
- true if and only if the underlying type is a member aspect
-
isPrivileged
public boolean isPrivileged()- Specified by:
isPrivilegedin interfaceAjType<T>- Returns:
- true if and only if the underlying type is a privileged aspect
-
equals
-
hashCode
public int hashCode() -
toString
-