Top Description Methods
org.aspectj.lang.reflect

public Interface AjType<T>

extends Type, AnnotatedElement
Known Direct Implementers
org.aspectj.internal.lang.reflect.AjTypeImpl
Imports
java.lang.reflect.AnnotatedElement, .Constructor, .Field, .Method, .Type, .TypeVariable

The runtime representation of a type (Aspect, Class, Interface, Annotation, Enum, or Array) in an AspectJ program.

Method Summary

Modifier and TypeMethod and Description
public Advice[]

Returns:

all of the advice for this type, of an advice kind contained in the parameter list.
getAdvice
(AdviceKind...
the AdviceKinds of interest
ofTypes
)

public Advice

Returns:

the advice with the given name.
getAdvice
(String
the advice name
name
)

For an annotation style advice member, this is the name of the annotated method.

public AjType<?>[]

Returns:

an array containing all the public types that are members of this type
getAjTypes
()

public Constructor<T>

Returns:

the constructor object for the specified public constructor of this type
getConstructor
(AjType<?>...
the types of the constructor parameters
parameterTypes
)

public Constructor<T>[]

Returns:

all of the public constructors of this type
getConstructors
()

public DeclareAnnotation[]

Returns:

all of the declare annotation members of this type, including declare annotation members inherited from super-types
getDeclareAnnotations
()

public Advice[]

Returns:

all of the advice declared by this type, of an advice kind contained in the parameter list.
getDeclaredAdvice
(AdviceKind...
the AdviceKinds of interest
ofTypes
)

public Advice

Returns:

the advice declared in this type with the given name.
getDeclaredAdvice
(String
the advice name
name
)

For an annotation style advice member, this is the name of the annotated method.

public AjType<?>[]

Returns:

an array containing all the types declared by this type
getDeclaredAjTypes
()

public Constructor<T>

Returns:

the constructor object for the specified constructor of this type
getDeclaredConstructor
(AjType<?>...
the types of the constructor parameters
parameterTypes
)

public Constructor<T>[]

Returns:

all the constructors declared in this type
getDeclaredConstructors
()

public Field

Returns:

the declared field
getDeclaredField
(String
the field name
name
)

public Field[]

Returns:

all the fields declared in this type
getDeclaredFields
()

public InterTypeConstructorDeclaration

Returns:

the inter-type constructor declared by this type matching the given specification
getDeclaredITDConstructor
(AjType<?>
the target of the inter-type constructor of interest
target
,
AjType<?>...
the types of the parameter of the inter-type constructor of interest
parameterTypes
)

public InterTypeConstructorDeclaration[]

Returns:

all of the inter-type constructors declared by this type
getDeclaredITDConstructors
()

public InterTypeFieldDeclaration

Returns:

the inter-type field declared in this type with the given specification
getDeclaredITDField
(String
the field name
name
,
AjType<?>
the target type for the inter-type declaration
target
)

public InterTypeFieldDeclaration[]

Returns:

all of the inter-type fields declared in this type
getDeclaredITDFields
()

public InterTypeMethodDeclaration

Returns:

the inter-type method declared by this type matching the given specification
getDeclaredITDMethod
(String
the method name
name
,
AjType<?>
the target of the inter-type declaration
target
,
AjType<?>...
the types of the inter-type method declaration
parameterTypes
)

public InterTypeMethodDeclaration[]

Returns:

all of the inter-type methods declared by this type
getDeclaredITDMethods
()

public Method

Returns:

the method object for the specified method declared in this type
getDeclaredMethod
(String
the method name
name
,
AjType<?>...
the types of the method parameters
parameterTypes
)

public Method[]

Returns:

all the methods declared by this type
getDeclaredMethods
()

public Pointcut

Returns:

the pointcut object representing the specified pointcut declared by this type
getDeclaredPointcut
(String
the pointcut name
name
)

public Pointcut[]

Returns:

all of the pointcuts declared by this type
getDeclaredPointcuts
()

public DeclareErrorOrWarning[]

Returns:

all of the declare error and declare warning members of this type, including declare error/warning members inherited from super-types
getDeclareErrorOrWarnings
()

public DeclareParents[]

Returns:

all of the declare parents members of this type, including declare parent members inherited from super-types
getDeclareParents
()

public DeclarePrecedence[]

Returns:

all of the declare precedence members of this type, including declare precedence members inherited from super-types
getDeclarePrecedence
()

public DeclareSoft[]

Returns:

all of the declare soft members of this type, including declare soft members inherited from super-types
getDeclareSofts
()

public AjType<?>

Returns:

the AjType representing the typei n which it was declared (if this type is a member of another type)
getDeclaringType
()

public Constructor<T>

Returns:

the enclosing Method if this type represents a local or anonymous type declared within a constructor
getEnclosingConstructor
()

public Method

Returns:

the enclosing Method if this type represents a local or anonymous type declared within a method
getEnclosingMethod
()

public AjType<?>

Returns:

the immediately enclosing type of this type.
getEnclosingType
()

public T[]

Returns:

the elements of this enum class, or null if this type does not represent an enum type.
getEnumConstants
()

public Field

Returns:

the public field with the given name
getField
(String
the field name
name
)

public Field[]

Returns:

the public fields declared by this type
getFields
()

public Type

Returns:

the generic supertype of this type, as defined by Class.getGenericSupertype
getGenericSupertype
()

public AjType<?>[]

Returns:

the interfaces implemented by this type
getInterfaces
()

public InterTypeConstructorDeclaration

Returns:

the public inter-type constructor matching the given specification
getITDConstructor
(AjType<?>
the target of the inter-type constructor of interest
target
,
AjType<?>...
the types of the parameter of the inter-type constructor of interest
parameterTypes
)

public InterTypeConstructorDeclaration[]

Returns:

all of the public inter-type constructors of this type
getITDConstructors
()

public InterTypeFieldDeclaration

Returns:

the public inter-type field matching the given specification
getITDField
(String
the field name
name
,
AjType<?>
the target type for the inter-type declaration
target
)

public InterTypeFieldDeclaration[]

Returns:

all of the public inter-type fields for this type
getITDFields
()

public InterTypeMethodDeclaration

Returns:

the public inter-type method of this type matching the given specification
getITDMethod
(String
the method name
name
,
AjType<?>
the target of the inter-type declaration
target
,
AjType<?>...
the types of the inter-type method declaration
parameterTypes
)

public InterTypeMethodDeclaration[]

Returns:

all of the public inter-type declared methods of this type
getITDMethods
()

public Class<T>

Returns:

the java.lang.Class that corresponds to this AjType
getJavaClass
()

public Method

Returns:

the method object for the specified public method declared in this type
getMethod
(String
the method name
name
,
AjType<?>...
the types of the method parameters
parameterTypes
)

public Method[]

Returns:

all the public methods of this type
getMethods
()

public int

Returns:

the modifiers declared for this type. The return value can be interpreted using java.lang.reflect.Modifier
getModifiers
()

public String

Returns:

the name of this type, in the same format as returned by Class.getName()
getName
()

public Package

Returns:

the package in which this type is declared
getPackage
()

public PerClause

Returns:

the per-clause if this is an aspect, otherwise null
getPerClause
()

public Pointcut

Returns:

the pointcut object representing the specified public pointcut
getPointcut
(String
the pointcut name
name
)

public Pointcut[]

Returns:

all of the public pointcuts of this type
getPointcuts
()

public AjType<?>

Returns:

the supertype of this type. If this type represents Object or a primitive type then null is returned.
getSupertype
()

public TypeVariable<Class<T>>[]

Returns:

an array of TypeVariable objects that represent the type variables declared by this type (if any)
getTypeParameters
()

public boolean

Returns:

true if this is an array type
isArray
()

public boolean

Returns:

true if this is an aspect type
isAspect
()

public boolean

Returns:

true if this is an enum type
isEnum
()

public boolean

Returns:

true if the given object is assignment-compatible with an object of the type represented by this AjType
isInstance
(Object
the object to check for assignment compatibility
o
)

public boolean

Returns:

true if this is an interface type
isInterface
()

public boolean

Returns:

true if and only if the underlying type is a local class
isLocalClass
()

public boolean

Returns:

true if and only if the underlying type is a member aspect
isMemberAspect
()

public boolean

Returns:

true if and only if the underlying type is a member class
isMemberClass
()

public boolean

Returns:

true if this object represents a primitive type
isPrimitive
()

public boolean

Returns:

true if and only if the underlying type is a privileged aspect
isPrivileged
()

Inherited from java.lang.reflect.AnnotatedElement:
getAnnotationgetAnnotationsgetAnnotationsByTypegetDeclaredAnnotationgetDeclaredAnnotationsgetDeclaredAnnotationsByTypeisAnnotationPresent
Inherited from java.lang.reflect.Type:
getTypeName

Method Detail

getAdviceback to summary
public Advice[] getAdvice(AdviceKind... ofTypes)
Parameters
ofTypes:AdviceKind[]

the AdviceKinds of interest

Returns:Advice[]

all of the advice for this type, of an advice kind contained in the parameter list.

getAdviceback to summary
public Advice getAdvice(String name) throws NoSuchAdviceException

For 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.

Parameters
name:String

the advice name

Returns:Advice

the advice with the given name.

Exceptions
NoSuchAdviceException:
if no advice can be found with that name
getAjTypesback to summary
public AjType<?>[] getAjTypes()
Returns:AjType<?>[]

an array containing all the public types that are members of this type

getConstructorback to summary
public Constructor<T> getConstructor(AjType<?>... parameterTypes) throws NoSuchMethodException
Parameters
parameterTypes:AjType<?>[]

the types of the constructor parameters

Returns:Constructor<T>

the constructor object for the specified public constructor of this type

Exceptions
NoSuchMethodException:
if constructor not found
getConstructorsback to summary
public Constructor<T>[] getConstructors()
Returns:Constructor<T>[]

all of the public constructors of this type

getDeclareAnnotationsback to summary
public DeclareAnnotation[] getDeclareAnnotations()
Returns:DeclareAnnotation[]

all of the declare annotation members of this type, including declare annotation members inherited from super-types

getDeclaredAdviceback to summary
public Advice[] getDeclaredAdvice(AdviceKind... ofTypes)
Parameters
ofTypes:AdviceKind[]

the AdviceKinds of interest

Returns:Advice[]

all of the advice declared by this type, of an advice kind contained in the parameter list.

getDeclaredAdviceback to summary
public Advice getDeclaredAdvice(String name) throws NoSuchAdviceException

For 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.

Parameters
name:String

the advice name

Returns:Advice

the advice declared in this type with the given name.

Exceptions
NoSuchAdviceException:
if no advice can be found with that name
getDeclaredAjTypesback to summary
public AjType<?>[] getDeclaredAjTypes()
Returns:AjType<?>[]

an array containing all the types declared by this type

getDeclaredConstructorback to summary
public Constructor<T> getDeclaredConstructor(AjType<?>... parameterTypes) throws NoSuchMethodException
Parameters
parameterTypes:AjType<?>[]

the types of the constructor parameters

Returns:Constructor<T>

the constructor object for the specified constructor of this type

Exceptions
NoSuchMethodException:
if constructor not found
getDeclaredConstructorsback to summary
public Constructor<T>[] getDeclaredConstructors()
Returns:Constructor<T>[]

all the constructors declared in this type

getDeclaredFieldback to summary
public Field getDeclaredField(String name) throws NoSuchFieldException
Parameters
name:String

the field name

Returns:Field

the declared field

Exceptions
NoSuchFieldException:
if no field of that name is found
getDeclaredFieldsback to summary
public Field[] getDeclaredFields()
Returns:Field[]

all the fields declared in this type

getDeclaredITDConstructorback to summary
public InterTypeConstructorDeclaration getDeclaredITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException
Parameters
target:AjType<?>

the target of the inter-type constructor of interest

parameterTypes:AjType<?>[]

the types of the parameter of the inter-type constructor of interest

Returns:InterTypeConstructorDeclaration

the inter-type constructor declared by this type matching the given specification

Exceptions
NoSuchMethodException:
if the inter-type declaration cannot be found
getDeclaredITDConstructorsback to summary
public InterTypeConstructorDeclaration[] getDeclaredITDConstructors()
Returns:InterTypeConstructorDeclaration[]

all of the inter-type constructors declared by this type

getDeclaredITDFieldback to summary
public InterTypeFieldDeclaration getDeclaredITDField(String name, AjType<?> target) throws NoSuchFieldException
Parameters
name:String

the field name

target:AjType<?>

the target type for the inter-type declaration

Returns:InterTypeFieldDeclaration

the inter-type field declared in this type with the given specification

Exceptions
NoSuchFieldException:
if the inter-type declaration cannot be found
getDeclaredITDFieldsback to summary
public InterTypeFieldDeclaration[] getDeclaredITDFields()
Returns:InterTypeFieldDeclaration[]

all of the inter-type fields declared in this type

getDeclaredITDMethodback to summary
public InterTypeMethodDeclaration getDeclaredITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException
Parameters
name:String

the method name

target:AjType<?>

the target of the inter-type declaration

parameterTypes:AjType<?>[]

the types of the inter-type method declaration

Returns:InterTypeMethodDeclaration

the inter-type method declared by this type matching the given specification

Exceptions
NoSuchMethodException:
if the inter-type declaration cannot be found
getDeclaredITDMethodsback to summary
public InterTypeMethodDeclaration[] getDeclaredITDMethods()
Returns:InterTypeMethodDeclaration[]

all of the inter-type methods declared by this type

getDeclaredMethodback to summary
public Method getDeclaredMethod(String name, AjType<?>... parameterTypes) throws NoSuchMethodException
Parameters
name:String

the method name

parameterTypes:AjType<?>[]

the types of the method parameters

Returns:Method

the method object for the specified method declared in this type

Exceptions
NoSuchMethodException:
if the method cannot be found
getDeclaredMethodsback to summary
public Method[] getDeclaredMethods()
Returns:Method[]

all the methods declared by this type

getDeclaredPointcutback to summary
public Pointcut getDeclaredPointcut(String name) throws NoSuchPointcutException
Parameters
name:String

the pointcut name

Returns:Pointcut

the pointcut object representing the specified pointcut declared by this type

Exceptions
NoSuchPointcutException:
if no pointcut of that name can be found
getDeclaredPointcutsback to summary
public Pointcut[] getDeclaredPointcuts()
Returns:Pointcut[]

all of the pointcuts declared by this type

getDeclareErrorOrWarningsback to summary
public DeclareErrorOrWarning[] getDeclareErrorOrWarnings()
Returns:DeclareErrorOrWarning[]

all of the declare error and declare warning members of this type, including declare error/warning members inherited from super-types

getDeclareParentsback to summary
public DeclareParents[] getDeclareParents()
Returns:DeclareParents[]

all of the declare parents members of this type, including declare parent members inherited from super-types

getDeclarePrecedenceback to summary
public DeclarePrecedence[] getDeclarePrecedence()
Returns:DeclarePrecedence[]

all of the declare precedence members of this type, including declare precedence members inherited from super-types

getDeclareSoftsback to summary
public DeclareSoft[] getDeclareSofts()
Returns:DeclareSoft[]

all of the declare soft members of this type, including declare soft members inherited from super-types

getDeclaringTypeback to summary
public AjType<?> getDeclaringType()
Returns:AjType<?>

the AjType representing the typei n which it was declared (if this type is a member of another type)

getEnclosingConstructorback to summary
public Constructor<T> getEnclosingConstructor()
Returns:Constructor<T>

the enclosing Method if this type represents a local or anonymous type declared within a constructor

getEnclosingMethodback to summary
public Method getEnclosingMethod()
Returns:Method

the enclosing Method if this type represents a local or anonymous type declared within a method

getEnclosingTypeback to summary
public AjType<?> getEnclosingType()
Returns:AjType<?>

the immediately enclosing type of this type.

getEnumConstantsback to summary
public T[] getEnumConstants()
Returns:T[]

the elements of this enum class, or null if this type does not represent an enum type.

getFieldback to summary
public Field getField(String name) throws NoSuchFieldException
Parameters
name:String

the field name

Returns:Field

the public field with the given name

Exceptions
NoSuchFieldException:
if field not found
getFieldsback to summary
public Field[] getFields()
Returns:Field[]

the public fields declared by this type

getGenericSupertypeback to summary
public Type getGenericSupertype()
Returns:Type

the generic supertype of this type, as defined by Class.getGenericSupertype

getInterfacesback to summary
public AjType<?>[] getInterfaces()
Returns:AjType<?>[]

the interfaces implemented by this type

getITDConstructorback to summary
public InterTypeConstructorDeclaration getITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException
Parameters
target:AjType<?>

the target of the inter-type constructor of interest

parameterTypes:AjType<?>[]

the types of the parameter of the inter-type constructor of interest

Returns:InterTypeConstructorDeclaration

the public inter-type constructor matching the given specification

Exceptions
NoSuchMethodException:
if the inter-type declaration cannot be found
getITDConstructorsback to summary
public InterTypeConstructorDeclaration[] getITDConstructors()
Returns:InterTypeConstructorDeclaration[]

all of the public inter-type constructors of this type

getITDFieldback to summary
public InterTypeFieldDeclaration getITDField(String name, AjType<?> target) throws NoSuchFieldException
Parameters
name:String

the field name

target:AjType<?>

the target type for the inter-type declaration

Returns:InterTypeFieldDeclaration

the public inter-type field matching the given specification

Exceptions
NoSuchFieldException:
if the inter-type declaration cannot be found
getITDFieldsback to summary
public InterTypeFieldDeclaration[] getITDFields()
Returns:InterTypeFieldDeclaration[]

all of the public inter-type fields for this type

getITDMethodback to summary
public InterTypeMethodDeclaration getITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException
Parameters
name:String

the method name

target:AjType<?>

the target of the inter-type declaration

parameterTypes:AjType<?>[]

the types of the inter-type method declaration

Returns:InterTypeMethodDeclaration

the public inter-type method of this type matching the given specification

Exceptions
NoSuchMethodException:
if the inter-type declaration cannot be found
getITDMethodsback to summary
public InterTypeMethodDeclaration[] getITDMethods()
Returns:InterTypeMethodDeclaration[]

all of the public inter-type declared methods of this type

getJavaClassback to summary
public Class<T> getJavaClass()
Returns:Class<T>

the java.lang.Class that corresponds to this AjType

getMethodback to summary
public Method getMethod(String name, AjType<?>... parameterTypes) throws NoSuchMethodException
Parameters
name:String

the method name

parameterTypes:AjType<?>[]

the types of the method parameters

Returns:Method

the method object for the specified public method declared in this type

Exceptions
NoSuchMethodException:
if the method cannot be found
getMethodsback to summary
public Method[] getMethods()
Returns:Method[]

all the public methods of this type

getModifiersback to summary
public int getModifiers()
Returns:int

the modifiers declared for this type. The return value can be interpreted using java.lang.reflect.Modifier

getNameback to summary
public String getName()
Returns:String

the name of this type, in the same format as returned by Class.getName()

getPackageback to summary
public Package getPackage()
Returns:Package

the package in which this type is declared

getPerClauseback to summary
public PerClause getPerClause()
Returns:PerClause

the per-clause if this is an aspect, otherwise null

getPointcutback to summary
public Pointcut getPointcut(String name) throws NoSuchPointcutException
Parameters
name:String

the pointcut name

Returns:Pointcut

the pointcut object representing the specified public pointcut

Exceptions
NoSuchPointcutException:
if no pointcut of that name can be found
getPointcutsback to summary
public Pointcut[] getPointcuts()
Returns:Pointcut[]

all of the public pointcuts of this type

getSupertypeback to summary
public AjType<?> getSupertype()
Returns:AjType<?>

the supertype of this type. If this type represents Object or a primitive type then null is returned.

getTypeParametersback to summary
public TypeVariable<Class<T>>[] getTypeParameters()
Returns:TypeVariable<Class<T>>[]

an array of TypeVariable objects that represent the type variables declared by this type (if any)

isArrayback to summary
public boolean isArray()
Returns:boolean

true if this is an array type

isAspectback to summary
public boolean isAspect()
Returns:boolean

true if this is an aspect type

isEnumback to summary
public boolean isEnum()
Returns:boolean

true if this is an enum type

isInstanceback to summary
public boolean isInstance(Object o)
Parameters
o:Object

the object to check for assignment compatibility

Returns:boolean

true if the given object is assignment-compatible with an object of the type represented by this AjType

isInterfaceback to summary
public boolean isInterface()
Returns:boolean

true if this is an interface type

isLocalClassback to summary
public boolean isLocalClass()
Returns:boolean

true if and only if the underlying type is a local class

isMemberAspectback to summary
public boolean isMemberAspect()
Returns:boolean

true if and only if the underlying type is a member aspect

isMemberClassback to summary
public boolean isMemberClass()
Returns:boolean

true if and only if the underlying type is a member class

isPrimitiveback to summary
public boolean isPrimitive()
Returns:boolean

true if this object represents a primitive type

isPrivilegedback to summary
public boolean isPrivileged()
Returns:boolean

true if and only if the underlying type is a privileged aspect