Section A.3. org.aspectj.lang.reflect


A.3. org.aspectj.lang.reflect

The org.aspectj.lang.reflect package contains a selection of more specialized classes that represent specific types of join points and the additional information that they may be able to provide at runtime.

The Specialized Subinterfaces of Signature

Depending on the join point, various specialized subinterfaces are available to access the particulars of the signatures on different join points. Figure A-3Figure A-3 shows the relationships between the different interfaces that can be associated with join points.

Figure A-4. The relationships between the Signature interface and its specialized subinterfaces


The AdviceSignature interface

Represents the signature on an advice block:


public Class getReturnType( )

Returns the type of the object that a particular advice block returns, if any

The CatchClauseSignature interface

Represents the signature of a catch code block:


public String getParameterName( )

Returns object name being passed as the parameter to a particular catch block


public Class getParameterType( )

Returns object type that is being passed as the parameter to a particular catch block

The CodeSignature interface

Represents the signature of a generic code block:


public Class[] getParameterTypes( )

Returns the types of any available parameters on a signature


public String[] getParameterNames( )

Returns the names of any available parameters on a signature


public Class[] getExceptionTypes( )

Returns the types of any available exceptions that can be raised on a signature

The ConstructorSignature interface

Represents a constructor's signature.

The FieldSignature interface

Represents the signature of a field access or modification:


public Class getFieldType( )

Returns field type being accessed or modified according to the signature and the associated join point

The InitializerSignature interface

Represents the signature of an object initialization.

The MemberSignature interface

Represents the signature of a join point that involves a class member.

The MethodSignature interface

Represents the signature on a method:


public Class getReturnType( )

Returns the type of the object that a particular method returns, if any

SourceLocation

The SourceLocation interface defines the information that can potentially be accessed about the location within the source that a particular join point was encountered. (See Figure A-4Figure A-4.)


public String getFileName( )

Returns the file name of the source file where the associated join point is located


public int getLine( )

Returns the line in the source file where the associated join point is located


public Class getWithinType( )

Returns the type that the join point is located within

Figure A-5. The SourceLocation interface




AspectJ Cookbook
Aspectj Cookbook
ISBN: 0596006543
EAN: 2147483647
Year: 2006
Pages: 203
Authors: Russ Miles

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net