org.aspectj.weaver
Class AbstractAnnotationAJ

java.lang.Object
  extended by org.aspectj.weaver.AbstractAnnotationAJ
All Implemented Interfaces:
AnnotationAJ
Direct Known Subclasses:
BcelAnnotation, StandardAnnotation

public abstract class AbstractAnnotationAJ
extends java.lang.Object
implements AnnotationAJ


Field Summary
protected  ResolvedType type
           
 
Fields inherited from interface org.aspectj.weaver.AnnotationAJ
EMPTY_ARRAY
 
Constructor Summary
AbstractAnnotationAJ(ResolvedType type)
           
 
Method Summary
 boolean allowedOnAnnotationType()
          return true if this annotation can target an annotation type
 boolean allowedOnField()
          
 boolean allowedOnRegularType()
          
 void ensureAtTargetInitialized()
          
abstract  java.util.Set<java.lang.String> getTargets()
          
 ResolvedType getType()
          
 java.lang.String getTypeName()
          
 java.lang.String getTypeSignature()
          
 java.lang.String getValidTargets()
          
abstract  boolean hasNamedValue(java.lang.String name)
          
abstract  boolean hasNameValuePair(java.lang.String name, java.lang.String value)
          
abstract  boolean isRuntimeVisible()
          
 boolean specifiesTarget()
          
abstract  java.lang.String stringify()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.aspectj.weaver.AnnotationAJ
getStringFormOfValue
 

Field Detail

type

protected final ResolvedType type
Constructor Detail

AbstractAnnotationAJ

public AbstractAnnotationAJ(ResolvedType type)
Method Detail

getType

public final ResolvedType getType()

Specified by:
getType in interface AnnotationAJ
Returns:
the type of the annotation

getTypeSignature

public final java.lang.String getTypeSignature()

Specified by:
getTypeSignature in interface AnnotationAJ
Returns:
the signature for the annotation type, eg. Lcom/foo/MyAnno;

getTypeName

public final java.lang.String getTypeName()

Specified by:
getTypeName in interface AnnotationAJ
Returns:
the type name for the annotation, eg. com.foo.MyAnno

allowedOnAnnotationType

public final boolean allowedOnAnnotationType()
return true if this annotation can target an annotation type

Specified by:
allowedOnAnnotationType in interface AnnotationAJ

allowedOnField

public final boolean allowedOnField()

Specified by:
allowedOnField in interface AnnotationAJ
Returns:
true if this annotation can be put on a field

allowedOnRegularType

public final boolean allowedOnRegularType()

Specified by:
allowedOnRegularType in interface AnnotationAJ
Returns:
true if this annotation can target a 'regular' type. A 'regular' type is enum/class/interface - it is *not* annotation.

ensureAtTargetInitialized

public final void ensureAtTargetInitialized()


getValidTargets

public final java.lang.String getValidTargets()

Specified by:
getValidTargets in interface AnnotationAJ
Returns:
String representation of the valid targets for this annotation, eg. "{TYPE,FIELD}"

specifiesTarget

public final boolean specifiesTarget()

Specified by:
specifiesTarget in interface AnnotationAJ
Returns:
true if this annotation is marked with @target

isRuntimeVisible

public abstract boolean isRuntimeVisible()

Specified by:
isRuntimeVisible in interface AnnotationAJ
Returns:
true if the annotation is marked for runtime visibility

getTargets

public abstract java.util.Set<java.lang.String> getTargets()

Specified by:
getTargets in interface AnnotationAJ
Returns:
for the @target annotation, this will return a set of the element-types it can be applied to. For other annotations , it returns the empty set.

hasNameValuePair

public abstract boolean hasNameValuePair(java.lang.String name,
                                         java.lang.String value)

Specified by:
hasNameValuePair in interface AnnotationAJ
Parameters:
name - the name of the annotation field
value - the value of the annotation field
Returns:
true if there is a value with the specified name and value

hasNamedValue

public abstract boolean hasNamedValue(java.lang.String name)

Specified by:
hasNamedValue in interface AnnotationAJ
Parameters:
name - the name of the value
Returns:
true if there is a value with that name

stringify

public abstract java.lang.String stringify()

Specified by:
stringify in interface AnnotationAJ
Returns:
String form of the annotation and any values, eg. @Foo(a=b,c=d)