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 class
AnnotationElemValue Used to store Annotation values(package private) static class
ArrayElemValue Annotation Element value referring to an Array(package private) static class
ClassElemValue Annotation Element value referring to a class(package private) static class
ConstElemValue Annotation Element value referring to a Constant(package private) static class
EnumElemValue Element Value for Enumsprivate static class
TTVis Target Type visitor, used for constructing the target-info within a type annotation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ParserAnnotation.TTVis
local handles on the scanner, main parser, and the error reporting env -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ParserAnnotation
(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 AnnotationData
scanAnnotation parses an individual annotation.protected DefaultAnnotationAttr
parseDefaultAnnotation parses a default Annotation attributeprotected void
parseParamAnnots
(int _totalParams, MethodData curMethod) parseParamAnnots Parses Parameter Annotations attributes.private AnnotationData
parseTypeAnnotation parses an individual annotation.private ParserAnnotation.ArrayElemValue
scanAnnotationArray
(String name) scanAnnotationArray Scans an Array of annotations.private Data
scanAnnotationClass
(String name) scanAnnotationEnum Scans an annotation enum val.private Data
scanAnnotationData
(String name) scanAnnotationData parses the internals of an annotation.private ParserAnnotation.EnumElemValue
scanAnnotationEnum
(String name) scanAnnotationEnum Scans an annotation enum val.private Data
scanAnnotationIdent
(String ident, String name) scanAnnotationIdent parses the identifier of an annotation.(package private) ArrayList<AnnotationData>
The main entry for parsing an annotation list.protected void
scanParamName
(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.SyntaxError
IOException
-
parseParamAnnots
protected void parseParamAnnots(int _totalParams, MethodData curMethod) throws Scanner.SyntaxError, IOException parseParamAnnots Parses Parameter Annotations attributes.- Parameters:
_totalParams
-curMethod
-- Throws:
Scanner.SyntaxError
IOException
-
parseTypeAnnotation
parseTypeAnnotation parses an individual annotation.- Returns:
- a parsed annotation.
- Throws:
IOException
Scanner.SyntaxError
-
parseAnnotation
scanAnnotation parses an individual annotation.- Returns:
- a parsed annotation.
- Throws:
IOException
Scanner.SyntaxError
-
_scanAnnotation
_scanAnnotation parses an individual annotation-data.- Throws:
IOException
Scanner.SyntaxError
-
_scanTypeTarget
_scanAnnotation parses an individual annotation-data.- Throws:
IOException
Scanner.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.SyntaxError
IOException
-
_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.SyntaxError
IOException
-
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
-