Class ArrayTypeSignature

    • Field Detail

      • typeSignatureStr

        private final java.lang.String typeSignatureStr
        The raw type signature string for the array type.
      • className

        private java.lang.String className
        Human-readable class name, e.g. "java.lang.String[]".
      • arrayClassInfo

        private ArrayClassInfo arrayClassInfo
        Array class info.
      • elementClassRef

        private java.lang.Class<?> elementClassRef
        The element class.
    • Constructor Detail

      • ArrayTypeSignature

        ArrayTypeSignature​(TypeSignature elementTypeSignature,
                           int numDims,
                           java.lang.String typeSignatureStr)
        Constructor.
        Parameters:
        elementTypeSignature - The type signature of the array elements.
        numDims - The number of array dimensions.
        typeSignatureStr - Raw array type signature string (e.g. "[[I")
    • Method Detail

      • getTypeSignatureStr

        public java.lang.String getTypeSignatureStr()
        Get the raw array type signature string, e.g. "[[I".
        Returns:
        the raw array type signature string.
      • getElementTypeSignature

        public TypeSignature getElementTypeSignature()
        Get the type signature of the innermost element type of the array.
        Returns:
        The type signature of the innermost element type.
      • getNumDimensions

        public int getNumDimensions()
        Get the number of dimensions of the array.
        Returns:
        The number of dimensions of the array.
      • getNestedType

        public TypeSignature getNestedType()
        Get the nested type, which is another ArrayTypeSignature with one dimension fewer, if this array has 2 or more dimensions, otherwise this returns the element type.
        Returns:
        The nested type.
      • getClassInfo

        protected ClassInfo getClassInfo()
        Description copied from class: ScanResultObject
        Get the ClassInfo object for the referenced class, or null if the referenced class was not encountered during scanning (i.e. no ClassInfo object was created for the class during scanning). N.B. even if this method returns null, ScanResultObject.loadClass() may be able to load the referenced class by name.
        Overrides:
        getClassInfo in class ScanResultObject
        Returns:
        The ClassInfo object for the referenced class.
      • findReferencedClassNames

        protected void findReferencedClassNames​(java.util.Set<java.lang.String> refdClassNames)
        Get the names of any classes referenced in the type signature.
        Overrides:
        findReferencedClassNames in class TypeSignature
        Parameters:
        refdClassNames - the referenced class names.
      • loadElementClass

        public java.lang.Class<?> loadElementClass​(boolean ignoreExceptions)
        Get a Class<?> reference for the innermost array element type. Causes the ClassLoader to load the class, if it is not already loaded.
        Parameters:
        ignoreExceptions - Whether or not to ignore exceptions.
        Returns:
        a Class<?> reference for the innermost array element type. Also works for arrays of primitive element type.
      • loadElementClass

        public java.lang.Class<?> loadElementClass()
        Get a Class<?> reference for the array element type. Causes the ClassLoader to load the element class, if it is not already loaded.
        Returns:
        a Class<?> reference for the array element type. Also works for arrays of primitive element type.
      • loadClass

        public java.lang.Class<?> loadClass​(boolean ignoreExceptions)
        Obtain a Class<?> reference for the array class named by this ArrayClassInfo object. Causes the ClassLoader to load the element class, if it is not already loaded.
        Overrides:
        loadClass in class ScanResultObject
        Parameters:
        ignoreExceptions - Whether or not to ignore exceptions.
        Returns:
        The class reference, or null, if ignoreExceptions is true and there was an exception or error loading the class.
        Throws:
        java.lang.IllegalArgumentException - if ignoreExceptions is false and there were problems loading the class.
      • loadClass

        public java.lang.Class<?> loadClass()
        Obtain a Class<?> reference for the array class named by this ArrayClassInfo object. Causes the ClassLoader to load the element class, if it is not already loaded.
        Overrides:
        loadClass in class ScanResultObject
        Returns:
        The class reference.
        Throws:
        java.lang.IllegalArgumentException - if there were problems loading the class.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toStringInternal

        protected void toStringInternal​(boolean useSimpleNames,
                                        AnnotationInfoList annotationsToExclude,
                                        java.lang.StringBuilder buf)
        Description copied from class: HierarchicalTypeSignature
        Render type signature to string.
        Specified by:
        toStringInternal in class HierarchicalTypeSignature
        Parameters:
        useSimpleNames - whether to use simple names for classes.
        annotationsToExclude - toplevel annotations to exclude, to eliminate duplication (toplevel annotations are both class/field/method annotations and type annotations).
        buf - the StringBuilder to write to.
      • parse

        static ArrayTypeSignature parse​(Parser parser,
                                        java.lang.String definingClassName)
                                 throws ParseException
        Parses the array type signature.
        Parameters:
        parser - the parser
        definingClassName - the defining class name
        Returns:
        the array type signature
        Throws:
        ParseException - if parsing fails