Class AnnotationParameterValue

    • Field Detail

      • name

        private java.lang.String name
        The the parameter name.
    • Constructor Detail

      • AnnotationParameterValue

        AnnotationParameterValue()
        Default constructor for deserialization.
      • AnnotationParameterValue

        AnnotationParameterValue​(java.lang.String name,
                                 java.lang.Object value)
        Constructor.
        Parameters:
        name - The annotation paramater name.
        value - The annotation parameter value.
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the annotation parameter name.
        Specified by:
        getName in interface HasName
        Returns:
        The annotation parameter name.
      • getValue

        public java.lang.Object getValue()
        Get the annotation parameter value.
        Returns:
        The annotation parameter value. May be one of the following types:
        • String for string constants
        • String[] for arrays of strings
        • A boxed type, e.g. Integer or Character, for primitive-typed constants
        • A 1-dimensional primitive-typed array (i.e. int[], long[], short[], char[], byte[], boolean[], float[], or double[]), for arrays of primitives
        • A 1-dimensional Object[] array for array types (and then the array element type may be one of the types in this list)
        • AnnotationEnumValue, for enum constants (this wraps the enum class and the string name of the constant)
        • AnnotationClassRef, for Class references within annotations (this wraps the name of the referenced class)
        • AnnotationInfo, for nested annotations
      • setValue

        void setValue​(java.lang.Object newValue)
        Set (update) the value of the annotation parameter. Used to replace Object[] arrays containing boxed types into primitive arrays.
        Parameters:
        newValue - the new value
      • 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.
      • setScanResult

        void setScanResult​(ScanResult scanResult)
        Description copied from class: ScanResultObject
        Set ScanResult backreferences in info objects after scan has completed.
        Overrides:
        setScanResult in class ScanResultObject
        Parameters:
        scanResult - the scan result
      • findReferencedClassInfo

        protected void findReferencedClassInfo​(java.util.Map<java.lang.String,​ClassInfo> classNameToClassInfo,
                                               java.util.Set<ClassInfo> refdClassInfo,
                                               LogNode log)
        Get ClassInfo objects for any classes referenced in the annotation parameters.
        Overrides:
        findReferencedClassInfo in class ScanResultObject
        Parameters:
        classNameToClassInfo - the map from class name to ClassInfo.
        refdClassInfo - the referenced class info
        log - the log
      • convertWrapperArraysToPrimitiveArrays

        void convertWrapperArraysToPrimitiveArrays​(ClassInfo annotationClassInfo)
        For primitive array type params, replace Object[] arrays containing boxed types with primitive arrays (need to check the type of each method of the annotation class to determine if it is a primitive array type).
        Parameters:
        annotationClassInfo - the annotation class info
      • instantiate

        java.lang.Object instantiate​(ClassInfo annotationClassInfo)
        Instantiate an annotation parameter value.
        Parameters:
        annotationClassInfo - the annotation class info
        Returns:
        the instance
      • equals

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

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

        protected void toString​(boolean useSimpleNames,
                                java.lang.StringBuilder buf)
        Description copied from class: ScanResultObject
        Render to string.
        Specified by:
        toString in class ScanResultObject
        Parameters:
        useSimpleNames - if true, use just the simple name of each class.
        buf - the buf
      • toString

        private static void toString​(java.lang.Object val,
                                     boolean useSimpleNames,
                                     java.lang.StringBuilder buf)
        Write an annotation parameter value's string representation to the buffer.
        Parameters:
        val - the value
        useSimpleNames - the use simple names
        buf - the buffer
      • toStringParamValueOnly

        void toStringParamValueOnly​(boolean useSimpleNames,
                                    java.lang.StringBuilder buf)
        To string, param value only.
        Parameters:
        buf - the buf
      • toStringParamValueOnly

        private java.lang.String toStringParamValueOnly()
        To string, param value only.
        Returns:
        the string.