com.thoughtworks.qdox.model
Class Annotation
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
Annotation
public Annotation(Type type,
AbstractBaseJavaEntity context,
java.util.Map namedParameters,
int lineNumber)
Annotation
public Annotation(Type type,
int line)
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