Class 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+)
    • Field Detail

      • ttVisitor

        private static ParserAnnotation.TTVis ttVisitor
        local handles on the scanner, main parser, and the error reporting 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
      • parseParamAnnots

        protected void parseParamAnnots​(int _totalParams,
                                        MethodData curMethod)
                                 throws Scanner.SyntaxError,
                                        java.io.IOException
        parseParamAnnots Parses Parameter Annotations attributes.
        Parameters:
        _totalParams -
        curMethod -
        Throws:
        Scanner.SyntaxError
        java.io.IOException
      • _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.SyntaxError
        java.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 identifier
        name - Annotation Name
        Returns:
        Basic Type Annotation data
        Throws:
        java.io.IOException - if scanning errors occur