Package com.thoughtworks.qdox.model.impl
Class DefaultJavaAnnotation
- java.lang.Object
-
- com.thoughtworks.qdox.model.impl.AbstractJavaModel
-
- com.thoughtworks.qdox.model.impl.DefaultJavaAnnotation
-
- All Implemented Interfaces:
AnnotationValue
,Expression
,JavaAnnotation
,JavaModel
,java.io.Serializable
public class DefaultJavaAnnotation extends AbstractJavaModel implements AnnotationValue, java.io.Serializable, JavaAnnotation
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Object>
namedParameters
Annotation properties as Parametersprivate java.util.Map<java.lang.String,AnnotationValue>
properties
Annotation properties as AnnotationValuesprivate JavaClass
type
-
Constructor Summary
Constructors Constructor Description DefaultJavaAnnotation(JavaClass type)
DefaultJavaAnnotation(JavaClass type, java.util.Map<java.lang.String,java.lang.Object> namedParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
accept(ExpressionVisitor visitor)
Accept a visitor for this value.java.lang.String
getCodeBlock()
java.lang.Object
getNamedParameter(java.lang.String key)
java.util.Map<java.lang.String,java.lang.Object>
getNamedParameterMap()
DefaultJavaAnnotation
getParameterValue()
Get a parameter value forJavaAnnotation.getNamedParameter(String)
.AnnotationValue
getProperty(java.lang.String name)
java.util.Map<java.lang.String,AnnotationValue>
getPropertyMap()
JavaClass
getType()
void
setProperty(java.lang.String name, AnnotationValue value)
java.lang.String
toString()
-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractJavaModel
getLineNumber, getModelWriter, setLineNumber, setModelWriterFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.thoughtworks.qdox.model.JavaModel
getLineNumber
-
-
-
-
Field Detail
-
type
private final JavaClass type
-
properties
private final java.util.Map<java.lang.String,AnnotationValue> properties
Annotation properties as AnnotationValuesThis 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<java.lang.String,java.lang.Object> namedParameters
Annotation properties as Parameters
-
-
Method Detail
-
setProperty
public final void setProperty(java.lang.String name, AnnotationValue value)
-
getType
public JavaClass getType()
- Specified by:
getType
in interfaceJavaAnnotation
- Returns:
- the annotation type
-
getNamedParameter
public java.lang.Object getNamedParameter(java.lang.String key)
- Specified by:
getNamedParameter
in interfaceJavaAnnotation
-
getNamedParameterMap
public java.util.Map<java.lang.String,java.lang.Object> getNamedParameterMap()
- Specified by:
getNamedParameterMap
in interfaceJavaAnnotation
-
getCodeBlock
public java.lang.String getCodeBlock()
- Specified by:
getCodeBlock
in interfaceJavaModel
- Returns:
- the codeblock
-
accept
public java.lang.Object accept(ExpressionVisitor visitor)
Accept a visitor for this value.- Specified by:
accept
in interfaceAnnotationValue
- Parameters:
visitor
- Visitor- Returns:
- Visitor result
-
getParameterValue
public DefaultJavaAnnotation getParameterValue()
Get a parameter value forJavaAnnotation.getNamedParameter(String)
.- Specified by:
getParameterValue
in interfaceExpression
- Returns:
- Parameter value
-
getPropertyMap
public java.util.Map<java.lang.String,AnnotationValue> getPropertyMap()
- Specified by:
getPropertyMap
in interfaceJavaAnnotation
-
getProperty
public AnnotationValue getProperty(java.lang.String name)
- Specified by:
getProperty
in interfaceJavaAnnotation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-