Package org.openjdk.asmtools.jasm
Class ParserAnnotation
java.lang.Object
org.openjdk.asmtools.jasm.ParseBase
org.openjdk.asmtools.jasm.ParserAnnotation
ParserAnnotation
ParserAnnotation is a parser class owned by Parser.java. It is primarily responsible
for parsing Annotations (for classes, methods or fields).
ParserAnnotation can parse the different types of Annotation Attributes:
Runtime(In)Visible Annotations (JDK 6+) Default Annotations (JDK 6+)
Runtime(In)VisibleParameter Annotations (JDK 7+) Runtime(In)VisibleType Annotations
(JSR308, JDK8+)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classAnnotationElemValue Used to store Annotation values(package private) static classArrayElemValue Annotation Element value referring to an Array(package private) static classClassElemValue Annotation Element value referring to a class(package private) static classConstElemValue Annotation Element value referring to a Constant(package private) static classEnumElemValue Element Value for Enumsprivate static classTTVis Target Type visitor, used for constructing the target-info within a type annotation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ParserAnnotation.TTVislocal handles on the scanner, main parser, and the error reporting env -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedParserAnnotation(Scanner scanner, Parser parser, Environment env) -
Method Summary
Modifier and TypeMethodDescriptionprivate void_scanAnnotation(AnnotationData annotData) _scanAnnotation parses an individual annotation-data.private void_scanTargetPath(TypeAnnotationData annotData) _scanTargetPath parses and fills the type_path structure (4.7.20.2) type_path { u1 path_length; { u1 type_path_kind; u1 type_argument_index; } path[path_length]; }_scanTypeLocation parses a path entry of the type_path.private void_scanTypeTarget(TypeAnnotationData annotData) _scanAnnotation parses an individual annotation-data.private AnnotationDatascanAnnotation parses an individual annotation.protected DefaultAnnotationAttrparseDefaultAnnotation parses a default Annotation attributeprotected voidparseParamAnnots(int _totalParams, MethodData curMethod) parseParamAnnots Parses Parameter Annotations attributes.private AnnotationDataparseTypeAnnotation parses an individual annotation.private ParserAnnotation.ArrayElemValuescanAnnotationArray(String name) scanAnnotationArray Scans an Array of annotations.private DatascanAnnotationClass(String name) scanAnnotationEnum Scans an annotation enum val.private DatascanAnnotationData(String name) scanAnnotationData parses the internals of an annotation.private ParserAnnotation.EnumElemValuescanAnnotationEnum(String name) scanAnnotationEnum Scans an annotation enum val.private DatascanAnnotationIdent(String ident, String name) scanAnnotationIdent parses the identifier of an annotation.(package private) ArrayList<AnnotationData> The main entry for parsing an annotation list.protected voidscanParamName(int totalParams, int paramNum, MethodData curMethod) Methods inherited from class org.openjdk.asmtools.jasm.ParseBase
debugScan, debugStr, enableDebug, init
-
Field Details
-
ttVisitor
local handles on the scanner, main parser, and the error reporting env
-
-
Constructor Details
-
ParserAnnotation
-
-
Method Details
-
scanParamName
protected void scanParamName(int totalParams, int paramNum, MethodData curMethod) throws IOException - Throws:
IOException
-
scanAnnotations
The main entry for parsing an annotation list.- Returns:
- An ArrayList of parsed annotations
- Throws:
IOException
-
parseDefaultAnnotation
parseDefaultAnnotation parses a default Annotation attribute- Returns:
- the parsed Annotation Attribute
- Throws:
Scanner.SyntaxErrorIOException
-
parseParamAnnots
protected void parseParamAnnots(int _totalParams, MethodData curMethod) throws Scanner.SyntaxError, IOException parseParamAnnots Parses Parameter Annotations attributes.- Parameters:
_totalParams-curMethod-- Throws:
Scanner.SyntaxErrorIOException
-
parseTypeAnnotation
parseTypeAnnotation parses an individual annotation.- Returns:
- a parsed annotation.
- Throws:
IOExceptionScanner.SyntaxError
-
parseAnnotation
scanAnnotation parses an individual annotation.- Returns:
- a parsed annotation.
- Throws:
IOExceptionScanner.SyntaxError
-
_scanAnnotation
_scanAnnotation parses an individual annotation-data.- Throws:
IOExceptionScanner.SyntaxError
-
_scanTypeTarget
_scanAnnotation parses an individual annotation-data.- Throws:
IOExceptionScanner.SyntaxError
-
_scanTargetPath
_scanTargetPath parses and fills the type_path structure (4.7.20.2) type_path { u1 path_length; { u1 type_path_kind; u1 type_argument_index; } path[path_length]; }- Throws:
Scanner.SyntaxErrorIOException
-
_scanTypePathEntry
private TypeAnnotationTypes.TypePathEntry _scanTypePathEntry() throws Scanner.SyntaxError, IOException_scanTypeLocation parses a path entry of the type_path. { u1 type_path_kind; u1 type_argument_index; }- Returns:
- a parsed type path.
- Throws:
Scanner.SyntaxErrorIOException
-
scanAnnotationArray
scanAnnotationArray Scans an Array of annotations.- Parameters:
name- Name of the annotation- Returns:
- Array Element
- Throws:
IOException- if scanning errors exist
-
scanAnnotationClass
scanAnnotationEnum Scans an annotation enum val.- Parameters:
name- Annotation Name- Returns:
- Constant element value for the Class Annotation.
- Throws:
IOException
-
scanAnnotationEnum
scanAnnotationEnum Scans an annotation enum val.- Parameters:
name- Annotation Name- Returns:
- Enumeration Element Value
- Throws:
IOException- for scanning errors.
-
scanAnnotationData
scanAnnotationData parses the internals of an annotation.- Parameters:
name- Annotation Name- Returns:
- a Data data structure containing the annotation data.
- Throws:
IOException- for scanning errors.
-
scanAnnotationIdent
scanAnnotationIdent parses the identifier of an annotation.- Parameters:
ident- Basic Type identifiername- Annotation Name- Returns:
- Basic Type Annotation data
- Throws:
IOException- if scanning errors occur
-