com.thoughtworks.qdox.model
Class Annotation

java.lang.Object
  extended by com.thoughtworks.qdox.model.Annotation
All Implemented Interfaces:
AnnotationValue, java.io.Serializable

public class Annotation
extends java.lang.Object
implements AnnotationValue, java.io.Serializable

Author:
Eric Redmond
See Also:
Serialized Form

Field Summary
private  AbstractBaseJavaEntity context
           
private  int lineNumber
           
private  java.util.Map namedParameters
          Annotation properties as Parameters
private  java.util.Map properties
          Annotation properties as AnnotationValues
private  Type type
           
 
Constructor Summary
Annotation(Type type, AbstractBaseJavaEntity context, java.util.Map namedParameters, int lineNumber)
           
Annotation(Type type, int line)
           
 
Method Summary
 java.lang.Object accept(AnnotationVisitor visitor)
          Accept a visitor for this value.
 AbstractBaseJavaEntity getContext()
           
 int getLineNumber()
           
 java.lang.Object getNamedParameter(java.lang.String key)
           
 java.util.Map getNamedParameterMap()
           
 java.lang.Object getParameterValue()
          Get a parameter value for getNamedParameter(String).
 AnnotationValue getProperty(java.lang.String name)
           
 java.util.Map getPropertyMap()
           
 Type getType()
           
 void setContext(AbstractBaseJavaEntity context)
           
 void setProperty(java.lang.String name, AnnotationValue value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private final Type type

lineNumber

private final int lineNumber

properties

private final java.util.Map properties
Annotation properties as AnnotationValues

This map contains the parsed AnnotationValue for each property and allows access to the full parse tree, including typerefs and expressions.


namedParameters

private final java.util.Map namedParameters
Annotation properties as Parameters


context

private AbstractBaseJavaEntity context
Constructor Detail

Annotation

public Annotation(Type type,
                  AbstractBaseJavaEntity context,
                  java.util.Map namedParameters,
                  int lineNumber)

Annotation

public Annotation(Type type,
                  int line)
Method Detail

setProperty

public void setProperty(java.lang.String name,
                        AnnotationValue value)

getType

public Type getType()
Returns:
the annotation type

getNamedParameter

public java.lang.Object getNamedParameter(java.lang.String key)
Parameters:
key - name of a named-parameter
Returns:
the corresponding value, or null if no such named-parameter was present

getNamedParameterMap

public java.util.Map getNamedParameterMap()
Returns:
a Map containing all the named-parameters

getContext

public final AbstractBaseJavaEntity getContext()

getLineNumber

public int getLineNumber()

accept

public java.lang.Object accept(AnnotationVisitor visitor)
Description copied from interface: AnnotationValue
Accept a visitor for this value.

Specified by:
accept in interface AnnotationValue
Parameters:
visitor - Visitor
Returns:
Visitor result

getParameterValue

public java.lang.Object getParameterValue()
Description copied from interface: AnnotationValue
Get a parameter value for getNamedParameter(String).

Specified by:
getParameterValue in interface AnnotationValue
Returns:
Parameter value

getPropertyMap

public java.util.Map getPropertyMap()

getProperty

public AnnotationValue getProperty(java.lang.String name)

setContext

public void setContext(AbstractBaseJavaEntity context)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object