Class AnnotationEntryGen


  • public class AnnotationEntryGen
    extends java.lang.Object
    Since:
    6.0
    • Constructor Detail

      • AnnotationEntryGen

        public AnnotationEntryGen​(AnnotationEntry a,
                                  ConstantPoolGen cpool,
                                  boolean copyPoolEntries)
        Here we are taking a fixed annotation of type Annotation and building a modifiable AnnotationGen object. If the pool passed in is for a different class file, then copyPoolEntries should have been passed as true as that will force us to do a deep copy of the annotation and move the cpool entries across. We need to copy the type and the element name value pairs and the visibility.
      • AnnotationEntryGen

        private AnnotationEntryGen​(ConstantPoolGen cpool)
    • Method Detail

      • getAnnotationAttributes

        static Attribute[] getAnnotationAttributes​(ConstantPoolGen cp,
                                                   AnnotationEntryGen[] annotationEntryGens)
        Converts a list of AnnotationGen objects into a set of attributes that can be attached to the class file.
        Parameters:
        cp - The constant pool gen where we can create the necessary name refs
        annotationEntryGens - An array of AnnotationGen objects
      • getParameterAnnotationAttributes

        static Attribute[] getParameterAnnotationAttributes​(ConstantPoolGen cp,
                                                            java.util.List<AnnotationEntryGen>[] vec)
        Annotations against a class are stored in one of four attribute kinds: - RuntimeVisibleParameterAnnotations - RuntimeInvisibleParameterAnnotations
      • dump

        public void dump​(java.io.DataOutputStream dos)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getAnnotation

        public AnnotationEntry getAnnotation()
        Retrieve an immutable version of this AnnotationGen
      • getTypeIndex

        public int getTypeIndex()
      • getTypeName

        public final java.lang.String getTypeName()
      • getTypeSignature

        public final java.lang.String getTypeSignature()
      • getValues

        public java.util.List<ElementValuePairGen> getValues()
        Returns list of ElementNameValuePair objects.
        Returns:
        list of ElementNameValuePair objects.
      • isRuntimeVisible

        public boolean isRuntimeVisible()
      • isRuntimeVisible

        private void isRuntimeVisible​(boolean b)
      • toShortString

        public java.lang.String toShortString()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object