com.thoughtworks.qdox.model

Class Annotation

Implemented Interfaces:
AnnotationValue, Serializable

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

Constructor Summary

Annotation(Type type, AbstractJavaEntity context, Map namedParameters, int lineNumber)
Annotation(Type type, int line)

Method Summary

Object
accept(AnnotationVisitor visitor)
Accept a visitor for this value.
AbstractJavaEntity
getContext()
int
getLineNumber()
Object
getNamedParameter(String key)
Map
getNamedParameterMap()
Object
getParameterValue()
Get a parameter value for getNamedParameter(String).
AnnotationValue
getProperty(String name)
Map
getPropertyMap()
Type
getType()
void
setContext(AbstractJavaEntity context)
void
setProperty(String name, AnnotationValue value)
String
toString()

Constructor Details

Annotation

public Annotation(Type type,
                  AbstractJavaEntity context,
                  Map namedParameters,
                  int lineNumber)

Annotation

public Annotation(Type type,
                  int line)

Method Details

accept

public Object accept(AnnotationVisitor visitor)
Accept a visitor for this value.
Specified by:
accept in interface AnnotationValue
Parameters:
visitor - Visitor
Returns:
Visitor result

getContext

public final AbstractJavaEntity getContext()

getLineNumber

public int getLineNumber()

getNamedParameter

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

getNamedParameterMap

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

getParameterValue

public Object getParameterValue()
Specified by:
getParameterValue in interface AnnotationValue
Returns:
Parameter value

getProperty

public AnnotationValue getProperty(String name)

getPropertyMap

public Map getPropertyMap()

getType

public Type getType()
Returns:
the annotation type

setContext

public void setContext(AbstractJavaEntity context)

setProperty

public void setProperty(String name,
                        AnnotationValue value)

toString

public String toString()