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>namedParametersAnnotation properties as Parametersprivate java.util.Map<java.lang.String,AnnotationValue>propertiesAnnotation properties as AnnotationValuesprivate JavaClasstype
-
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.Objectaccept(ExpressionVisitor visitor)Accept a visitor for this value.java.lang.StringgetCodeBlock()java.lang.ObjectgetNamedParameter(java.lang.String key)java.util.Map<java.lang.String,java.lang.Object>getNamedParameterMap()DefaultJavaAnnotationgetParameterValue()Get a parameter value forJavaAnnotation.getNamedParameter(String).AnnotationValuegetProperty(java.lang.String name)java.util.Map<java.lang.String,AnnotationValue>getPropertyMap()JavaClassgetType()voidsetProperty(java.lang.String name, AnnotationValue value)java.lang.StringtoString()-
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:
getTypein interfaceJavaAnnotation- Returns:
- the annotation type
-
getNamedParameter
public java.lang.Object getNamedParameter(java.lang.String key)
- Specified by:
getNamedParameterin interfaceJavaAnnotation
-
getNamedParameterMap
public java.util.Map<java.lang.String,java.lang.Object> getNamedParameterMap()
- Specified by:
getNamedParameterMapin interfaceJavaAnnotation
-
getCodeBlock
public java.lang.String getCodeBlock()
- Specified by:
getCodeBlockin interfaceJavaModel- Returns:
- the codeblock
-
accept
public java.lang.Object accept(ExpressionVisitor visitor)
Accept a visitor for this value.- Specified by:
acceptin interfaceAnnotationValue- Parameters:
visitor- Visitor- Returns:
- Visitor result
-
getParameterValue
public DefaultJavaAnnotation getParameterValue()
Get a parameter value forJavaAnnotation.getNamedParameter(String).- Specified by:
getParameterValuein interfaceExpression- Returns:
- Parameter value
-
getPropertyMap
public java.util.Map<java.lang.String,AnnotationValue> getPropertyMap()
- Specified by:
getPropertyMapin interfaceJavaAnnotation
-
getProperty
public AnnotationValue getProperty(java.lang.String name)
- Specified by:
getPropertyin interfaceJavaAnnotation
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-