Top Description Inners Fields Constructors Methods
org.aspectj.weaver.bcel

public Class AtAjAttributes

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, java.lang.reflect.Modifier, java.util.ArrayList, .Arrays, .Collections, .Comparator, .Iterator, .List, .StringTokenizer, org.aspectj.apache.bcel.Constants, org.aspectj.apache.bcel.classfile.Attribute, .Constant, .ConstantUtf8, .Field, .JavaClass, .LocalVariable, .LocalVariableTable, .Method, .Unknown, org.aspectj.apache.bcel.classfile.annotation.AnnotationGen, .ArrayElementValue, .ClassElementValue, .ElementValue, .NameValuePair, .RuntimeAnnos, .RuntimeVisAnnos, org.aspectj.apache.bcel.generic.Type, org.aspectj.asm.AsmManager, .IHierarchy, .IProgramElement, org.aspectj.bridge.IMessage, .IMessageHandler, .ISourceLocation, .Message, .MessageUtil, org.aspectj.weaver.Advice, .AdviceKind, .AjAttribute, .AjAttribute.WeaverVersionInfo, .AjcMemberMaker, .BindingScope, .ISourceContext, .MethodDelegateTypeMunger, .NameMangler, .ReferenceType, .ReferenceTypeDelegate, .ResolvedMember, .ResolvedPointcutDefinition, .ResolvedType, .UnresolvedType, .VersionedDataInputStream, .WeaverMessages, .World, org.aspectj.weaver.patterns.DeclareErrorOrWarning, .DeclareParents, .DeclareParentsMixin, .DeclarePrecedence, .FormalBinding, .IScope, .ParserException, .PatternParser, .PerCflow, .PerClause, .PerFromSuper, .PerObject, .PerSingleton, .PerTypeWithin, .Pointcut, .TypePattern

Annotation defined aspect reader. Reads the Java 5 annotations and turns them into AjAttributes
Author
Alexandre Vasseur (alex AT gnilux DOT com)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
AtAjAttributes.AjAttributeFieldStruct

A struct when we read @AJ on field

private static class
AtAjAttributes.AjAttributeMethodStruct

A struct when we read @AJ on method

private static class
AtAjAttributes.AjAttributeStruct

A struct that allows to add extra arguments without always breaking the API

public static class
AtAjAttributes.LazyResolvedPointcutDefinition

LazyResolvedPointcutDefinition lazyly resolve the pointcut so that we have time to register all pointcut referenced before pointcut resolution happens

private static class
AtAjAttributes.MethodArgument

A method argument, used for sorting by indexOnStack (ie order in signature)

pack-priv static class
pack-priv static class
private static class
AtAjAttributes.UnreadableDebugInfoException

A check exception when we cannot read debug info (needed for formal binding)

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String[]
private static final List<AjAttribute>
private static final char
private static final String
private static final String
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if runtime visible annotation
acceptAttribute
(Attribute attribute)

Annotations are RuntimeVisible only.

private static String[]
private static FormalBinding[]

Returns:

null if no debug info is available
extractBindings
(AtAjAttributes.AjAttributeMethodStruct struct)

Build the bindings for a given method (pointcut / advice)

private static FormalBinding[]
private static int

Returns:

extra arg flag
extractExtraArgument
(Method method)

Compute the flag for the xxxJoinPoint extra argument

public static int

Returns:

extra arg flag
extractExtraArgument
(String[] argumentSignatures)

Compute the flag for the xxxJoinPoint extra argument

private static AnnotationGen

Returns:

annotation
getAnnotation
(RuntimeAnnos rvs, UnresolvedType annotationType)

Returns the runtime (RV/RIV) annotation of type annotationType or null if no such annotation

private static NameValuePair

Returns:

annotation NVP
getAnnotationElement
(AnnotationGen annotation, String elementName)

Returns the value of a given element of an annotation or null if not found Caution: Does not handles default value.

private static String
getArgNamesValue(AnnotationGen anno)

Return the argNames set for an annotation or null if it is not specified.

private static String[]

Returns:

method argument names
getMethodArgumentNames
(Method method, String argNamesFromAnnotation, AtAjAttributes.AjAttributeMethodStruct methodStruct)

Extract the method argument names.

public static String

Returns:

a nicely formatted method string, for example: int X.foo(java.lang.String)
getMethodForMessage
(AtAjAttributes.AjAttributeMethodStruct methodstructure)

private static boolean

Returns:

true if found
handleAfterAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut)

Read @After

private static boolean

Returns:

true if found
handleAfterReturningAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut, BcelMethod owningMethod)

Read @AfterReturning

private static boolean

Returns:

true if found
handleAfterThrowingAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut, BcelMethod owningMethod)

Read @AfterThrowing

private static boolean

Returns:

true if found
handleAroundAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut)

Read @Around

private static boolean

Returns:

true if found
handleAspectAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeStruct struct)

Read @Aspect

private static boolean

Returns:

true if found
handleBeforeAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut)

Read @Before

private static boolean

Returns:

true if found
handleDeclareErrorOrWarningAnnotation
(AsmManager model, RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeFieldStruct struct)

Read @DeclareError, @DeclareWarning

private static boolean

Returns:

true if found
handleDeclareMixinAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeMethodStruct struct)

Process any @DeclareMixin annotation.

private static boolean
private static boolean

Returns:

true if a pointcut was handled
handlePointcutAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeMethodStruct struct)

Read @Pointcut and handle the resolving in a lazy way to deal with pointcut references

private static boolean

Returns:

true if found
handlePrecedenceAnnotation
(RuntimeAnnos runtimeAnnotations, AtAjAttributes.AjAttributeStruct struct)

Read @DeclarePrecedence

private static boolean
hasIf(Pointcut pointcut)

private static boolean

Returns:

true if empty or null
isNullOrEmpty
(String s)

Helper to test empty strings

private static String
lastbit(String fqname)

private static String

Returns:

a readable representation of a method
methodToString
(Method method)

Returns a readable representation of a method.

private static PerClause

Returns:

a PerClause instance
parsePerClausePointcut
(String
like "pertarget(.....)"
perClauseString
,
AtAjAttributes.AjAttributeStruct
for which we are parsing the per clause
struct
)

Read a perClause, returns null on failure and issue messages

private static Pointcut

Returns:

pointcut, unresolved
parsePointcut
(String pointcutString, AtAjAttributes.AjAttributeStruct struct, boolean allowIf)

Parse the given pointcut, return null on failure and issue an error

private static TypePattern

Returns:

type pattern
parseTypePattern
(String patternString, AtAjAttributes.AjAttributeStruct location)

Parse the given type pattern, return null on failure and issue an error

public static List<AjAttribute>

Returns:

list of AjAttributes
readAj5ClassAttributes
(AsmManager model, JavaClass javaClass, ReferenceType type, ISourceContext context, IMessageHandler msgHandler, boolean isCodeStyleAspect)

Extract class level annotations and turn them into AjAttributes.

public static List<AjAttribute>

Returns:

list of AjAttributes, always empty for now
readAj5FieldAttributes
(Field field, BcelField bField, ResolvedType type, ISourceContext context, IMessageHandler msgHandler)

Extract field level annotations and turn them into AjAttributes.

public static List<AjAttribute>

Returns:

list of AjAttributes
readAj5MethodAttributes
(Method method, BcelMethod bMethod, ResolvedType type, ResolvedPointcutDefinition preResolvedPointcut, ISourceContext context, IMessageHandler msgHandler)

Extract method level annotations and turn them into AjAttributes.

private static void
reportError(String message, AtAjAttributes.AjAttributeStruct location)

Report an error

private static void
reportWarning(String message, AtAjAttributes.AjAttributeStruct location)

Report a warning

private static void
setDeclareErrorOrWarningLocation(AsmManager model, DeclareErrorOrWarning deow, AtAjAttributes.AjAttributeFieldStruct struct)

Sets the location for the declare error / warning using the corresponding IProgramElement in the structure model.

private static void
setIgnoreUnboundBindingNames(Pointcut pointcut, FormalBinding[] bindings)

Set the pointcut bindings for which to ignore unbound issues, so that we can implicitly bind xxxJoinPoint for @AJ advices

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait