public class AnnotationParser extends java.lang.Object implements AnnotationParserVisitor
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_VALUE_NAME
The default value's name.
|
protected java.lang.Class |
m_annotationClass
The top level annotation interface class.
|
protected AnnotationVisitor |
m_bytecodeMunger
The top level annotation bytecode munger.
|
protected static AnnotationParser |
PARSER
The one and only annotation javadoc.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Class |
getElementTypeFor(java.lang.Class annotationInterface,
java.lang.String valueName)
Returns the expected type for an annotation value.
|
protected void |
handleAnnotation(ASTAnnotation node,
org.codehaus.backport175.compiler.parser.ParseContext ctx) |
protected java.lang.Object |
handleClassIdentifier(java.lang.String identifier,
org.codehaus.backport175.compiler.parser.ParseContext ctx) |
protected void |
handleNestedAnnotation(ASTAnnotation node,
org.codehaus.backport175.compiler.parser.ParseContext ctx) |
protected java.lang.Object |
handleReferenceIdentifier(java.lang.String identifier,
org.codehaus.backport175.compiler.parser.ParseContext ctx) |
protected boolean |
isJavaReferenceType(java.lang.String valueAsString) |
static void |
parse(AnnotationVisitor bytecodeMunger,
RawAnnotation rawAnnotation)
Parses the raw annotation.
|
static void |
parse(AnnotationVisitor bytecodeMunger,
RawAnnotation rawAnnotation,
java.lang.String desc)
Parses the raw annotation for an annotation default value, whose type checking depends
on the annotation element method desc if specified.
|
java.lang.Object |
visit(ASTAnnotation node,
java.lang.Object data) |
java.lang.Object |
visit(ASTArray node,
java.lang.Object data) |
java.lang.Object |
visit(ASTBoolean node,
java.lang.Object data) |
java.lang.Object |
visit(ASTChar node,
java.lang.Object data) |
java.lang.Object |
visit(ASTFloat node,
java.lang.Object data) |
java.lang.Object |
visit(ASTHex node,
java.lang.Object data) |
java.lang.Object |
visit(ASTIdentifier node,
java.lang.Object data) |
java.lang.Object |
visit(ASTInteger node,
java.lang.Object data) |
java.lang.Object |
visit(ASTKeyValuePair node,
java.lang.Object data) |
java.lang.Object |
visit(ASTOct node,
java.lang.Object data) |
java.lang.Object |
visit(ASTRoot node,
java.lang.Object data) |
java.lang.Object |
visit(ASTString node,
java.lang.Object data) |
java.lang.Object |
visit(SimpleNode node,
java.lang.Object data) |
public static final java.lang.String DEFAULT_VALUE_NAME
protected static final AnnotationParser PARSER
protected java.lang.Class m_annotationClass
protected AnnotationVisitor m_bytecodeMunger
public static void parse(AnnotationVisitor bytecodeMunger, RawAnnotation rawAnnotation)
bytecodeMunger
- rawAnnotation
- public static void parse(AnnotationVisitor bytecodeMunger, RawAnnotation rawAnnotation, java.lang.String desc)
bytecodeMunger
- rawAnnotation
- desc
- expected type for annotation default value. If null, assume we visit a regular annotationpublic java.lang.Object visit(SimpleNode node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTRoot node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTAnnotation node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTKeyValuePair node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTIdentifier node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTBoolean node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTChar node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTString node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTInteger node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTFloat node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTHex node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTOct node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
public java.lang.Object visit(ASTArray node, java.lang.Object data)
visit
in interface AnnotationParserVisitor
protected java.lang.Class getElementTypeFor(java.lang.Class annotationInterface, java.lang.String valueName)
annotationInterface
- valueName
- protected void handleAnnotation(ASTAnnotation node, org.codehaus.backport175.compiler.parser.ParseContext ctx)
protected void handleNestedAnnotation(ASTAnnotation node, org.codehaus.backport175.compiler.parser.ParseContext ctx)
protected java.lang.Object handleClassIdentifier(java.lang.String identifier, org.codehaus.backport175.compiler.parser.ParseContext ctx)
protected java.lang.Object handleReferenceIdentifier(java.lang.String identifier, org.codehaus.backport175.compiler.parser.ParseContext ctx)
protected boolean isJavaReferenceType(java.lang.String valueAsString)