Package org.openjdk.asmtools.jasm
Class ParserAnnotation
- java.lang.Object
-
- org.openjdk.asmtools.jasm.ParseBase
-
- org.openjdk.asmtools.jasm.ParserAnnotation
-
public class ParserAnnotation extends ParseBase
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 Classes Modifier and Type Class Description (package private) static classParserAnnotation.AnnotationElemValueAnnotationElemValue Used to store Annotation values(package private) static classParserAnnotation.ArrayElemValueArrayElemValue Annotation Element value referring to an Array(package private) static classParserAnnotation.ClassElemValueClassElemValue Annotation Element value referring to a class(package private) static classParserAnnotation.ConstElemValueConstElemValue Annotation Element value referring to a Constant(package private) static classParserAnnotation.EnumElemValueEnumElemValue Element Value for Enumsprivate static classParserAnnotation.TTVisTTVis Target Type visitor, used for constructing the target-info within a type annotation.
-
Constructor Summary
Constructors Modifier Constructor Description protectedParserAnnotation(Scanner scanner, Parser parser, Environment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private 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]; }private TypeAnnotationTypes.TypePathEntry_scanTypePathEntry()_scanTypeLocation parses a path entry of the type_path.private void_scanTypeTarget(TypeAnnotationData annotData)_scanAnnotation parses an individual annotation-data.private AnnotationDataparseAnnotation()scanAnnotation parses an individual annotation.protected DefaultAnnotationAttrparseDefaultAnnotation()parseDefaultAnnotation parses a default Annotation attributeprotected voidparseParamAnnots(int _totalParams, MethodData curMethod)parseParamAnnots Parses Parameter Annotations attributes.private AnnotationDataparseTypeAnnotation()parseTypeAnnotation parses an individual annotation.private ParserAnnotation.ArrayElemValuescanAnnotationArray(java.lang.String name)scanAnnotationArray Scans an Array of annotations.private DatascanAnnotationClass(java.lang.String name)scanAnnotationEnum Scans an annotation enum val.private DatascanAnnotationData(java.lang.String name)scanAnnotationData parses the internals of an annotation.private ParserAnnotation.EnumElemValuescanAnnotationEnum(java.lang.String name)scanAnnotationEnum Scans an annotation enum val.private DatascanAnnotationIdent(java.lang.String ident, java.lang.String name)scanAnnotationIdent parses the identifier of an annotation.(package private) java.util.ArrayList<AnnotationData>scanAnnotations()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 Detail
-
ttVisitor
private static ParserAnnotation.TTVis ttVisitor
local handles on the scanner, main parser, and the error reporting env
-
-
Constructor Detail
-
ParserAnnotation
protected ParserAnnotation(Scanner scanner, Parser parser, Environment env)
-
-
Method Detail
-
scanParamName
protected void scanParamName(int totalParams, int paramNum, MethodData curMethod) throws java.io.IOException- Throws:
java.io.IOException
-
scanAnnotations
java.util.ArrayList<AnnotationData> scanAnnotations() throws java.io.IOException
The main entry for parsing an annotation list.- Returns:
- An ArrayList of parsed annotations
- Throws:
java.io.IOException
-
parseDefaultAnnotation
protected DefaultAnnotationAttr parseDefaultAnnotation() throws Scanner.SyntaxError, java.io.IOException
parseDefaultAnnotation parses a default Annotation attribute- Returns:
- the parsed Annotation Attribute
- Throws:
Scanner.SyntaxErrorjava.io.IOException
-
parseParamAnnots
protected void parseParamAnnots(int _totalParams, MethodData curMethod) throws Scanner.SyntaxError, java.io.IOExceptionparseParamAnnots Parses Parameter Annotations attributes.- Parameters:
_totalParams-curMethod-- Throws:
Scanner.SyntaxErrorjava.io.IOException
-
parseTypeAnnotation
private AnnotationData parseTypeAnnotation() throws Scanner.SyntaxError, java.io.IOException
parseTypeAnnotation parses an individual annotation.- Returns:
- a parsed annotation.
- Throws:
java.io.IOExceptionScanner.SyntaxError
-
parseAnnotation
private AnnotationData parseAnnotation() throws Scanner.SyntaxError, java.io.IOException
scanAnnotation parses an individual annotation.- Returns:
- a parsed annotation.
- Throws:
java.io.IOExceptionScanner.SyntaxError
-
_scanAnnotation
private void _scanAnnotation(AnnotationData annotData) throws Scanner.SyntaxError, java.io.IOException
_scanAnnotation parses an individual annotation-data.- Throws:
java.io.IOExceptionScanner.SyntaxError
-
_scanTypeTarget
private void _scanTypeTarget(TypeAnnotationData annotData) throws Scanner.SyntaxError, java.io.IOException
_scanAnnotation parses an individual annotation-data.- Throws:
java.io.IOExceptionScanner.SyntaxError
-
_scanTargetPath
private void _scanTargetPath(TypeAnnotationData annotData) throws Scanner.SyntaxError, java.io.IOException
_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.SyntaxErrorjava.io.IOException
-
_scanTypePathEntry
private TypeAnnotationTypes.TypePathEntry _scanTypePathEntry() throws Scanner.SyntaxError, java.io.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.SyntaxErrorjava.io.IOException
-
scanAnnotationArray
private ParserAnnotation.ArrayElemValue scanAnnotationArray(java.lang.String name) throws java.io.IOException
scanAnnotationArray Scans an Array of annotations.- Parameters:
name- Name of the annotation- Returns:
- Array Element
- Throws:
java.io.IOException- if scanning errors exist
-
scanAnnotationClass
private Data scanAnnotationClass(java.lang.String name) throws java.io.IOException
scanAnnotationEnum Scans an annotation enum val.- Parameters:
name- Annotation Name- Returns:
- Constant element value for the Class Annotation.
- Throws:
java.io.IOException
-
scanAnnotationEnum
private ParserAnnotation.EnumElemValue scanAnnotationEnum(java.lang.String name) throws java.io.IOException
scanAnnotationEnum Scans an annotation enum val.- Parameters:
name- Annotation Name- Returns:
- Enumeration Element Value
- Throws:
java.io.IOException- for scanning errors.
-
scanAnnotationData
private Data scanAnnotationData(java.lang.String name) throws java.io.IOException
scanAnnotationData parses the internals of an annotation.- Parameters:
name- Annotation Name- Returns:
- a Data data structure containing the annotation data.
- Throws:
java.io.IOException- for scanning errors.
-
scanAnnotationIdent
private Data scanAnnotationIdent(java.lang.String ident, java.lang.String name) throws java.io.IOException
scanAnnotationIdent parses the identifier of an annotation.- Parameters:
ident- Basic Type identifiername- Annotation Name- Returns:
- Basic Type Annotation data
- Throws:
java.io.IOException- if scanning errors occur
-
-