Package serp.bytecode

Class Annotation.Property

    • Constructor Detail

    • Method Detail

      • getAnnotation

        public Annotation getAnnotation()
        The owning annotation.
      • invalidate

        void invalidate()
      • getNameIndex

        public int getNameIndex()
        Return the index in the class ConstantPool of the UTF8Entry holding the name of this property.
      • setNameIndex

        public void setNameIndex​(int index)
        Set the index in the class ConstantPool of the UTF8Entry holding the name of this property.
      • getName

        public java.lang.String getName()
        Return the name of this property.
      • setName

        public void setName​(java.lang.String name)
        Set the name of this property.
      • getValue

        public java.lang.Object getValue()
        Return the value of the property as its wrapper type. Returns class values as the class name.
      • setValue

        public void setValue​(java.lang.Object value)
        Set value of this property. The value should be an instance of any primitive wrapper type, String, Class, BCClass, an enum constant, an annotation, or an array of any of these types.
      • getEnumName

        private static java.lang.String getEnumName​(java.lang.Object o)
        Return the name of this enum value, or null if not an enum.
      • getStringValue

        public java.lang.String getStringValue()
        Return the string value of this property, or null if not set.
      • getBooleanValue

        public boolean getBooleanValue()
        Return the boolean value of this property, or false if not set.
      • getByteValue

        public byte getByteValue()
        Return the byte value of this property, or false if not set.
      • getIntValue

        public int getIntValue()
        Return the int value of this property, or 0 if not set.
      • getLongValue

        public long getLongValue()
        Return the long value of this property, or 0 if not set.
      • getFloatValue

        public float getFloatValue()
        Return the float value of this property, or 0 if not set.
      • getDoubleValue

        public double getDoubleValue()
        Return the double value of this property, or 0 if not set.
      • getShortValue

        public short getShortValue()
        Return the short value of this property, or 0 if not set.
      • getClassNameValue

        public java.lang.String getClassNameValue()
        Return the class value of this property, or null if not set.
      • getAnnotationValue

        public Annotation getAnnotationValue()
        Return the annotation value of this property, or null if not set.
      • setValue

        public void setValue​(java.lang.String value)
        Set the string value of this property.
      • setValue

        private void setValue​(Annotation.Property.Value val,
                              java.lang.String o)
        Set the string value of this property.
      • setValue

        public void setValue​(boolean value)
        Set the boolean value of this property.
      • setValue

        public void setValue​(byte value)
        Set the byte value of this property.
      • setValue

        public void setValue​(int value)
        Set the int value of this property.
      • setValue

        public void setValue​(long value)
        Set the long value of this property.
      • setValue

        public void setValue​(float value)
        Set the float value of this property.
      • setValue

        public void setValue​(double value)
        Set the double value of this property.
      • setValue

        public void setValue​(short value)
        Set the short value of this property.
      • setValue

        public void setValue​(java.lang.Class value)
        Set the class value of this property.
      • setValue

        public void setValue​(BCClass value)
        Set the class value of this property.
      • setClassNameValue

        public void setClassNameValue​(java.lang.String value)
        Set the class value of this property.
      • setClassNameValue

        private void setClassNameValue​(Annotation.Property.Value val,
                                       java.lang.String o)
        Set the class value of this property.
      • setValue

        public Annotation setValue​(Annotation value)
        Set the annotation value of this property by importing the given annotation from another instance.
      • setValue

        public Annotation[] setValue​(Annotation[] value)
        Set the annotation value of this property by importing the given annotation from another instance.
      • newAnnotationValue

        public Annotation newAnnotationValue​(java.lang.Class type)
        Set this property value to a new annotation of the given type, returning the annotation for manipulation.
      • newAnnotationValue

        public Annotation newAnnotationValue​(BCClass type)
        Set this property value to a new annotation of the given type, returning the annotation for manipulation.
      • newAnnotationValue

        public Annotation newAnnotationValue​(java.lang.String type)
        Set this property value to a new annotation of the given type, returning the annotation for manipulation.
      • newAnnotationArrayValue

        public Annotation[] newAnnotationArrayValue​(java.lang.Class type,
                                                    int length)
        Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.
      • newAnnotationArrayValue

        public Annotation[] newAnnotationArrayValue​(BCClass type,
                                                    int length)
        Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.
      • newAnnotationArrayValue

        public Annotation[] newAnnotationArrayValue​(java.lang.String type,
                                                    int length)
        Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.
      • getProject

        public Project getProject()
        Description copied from interface: BCEntity
        Return the project of the current class.
        Specified by:
        getProject in interface BCEntity
      • getPool

        public ConstantPool getPool()
        Description copied from interface: BCEntity
        Return the constant pool of the current class.
        Specified by:
        getPool in interface BCEntity
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Description copied from interface: BCEntity
        Return the class loader to use when loading related classes.
        Specified by:
        getClassLoader in interface BCEntity
      • isValid

        public boolean isValid()
        Description copied from interface: BCEntity
        Return false if this entity has been removed from its parent; in this case the results of any operations on the entity are undefined.
        Specified by:
        isValid in interface BCEntity
      • acceptVisit

        public void acceptVisit​(BCVisitor visit)
        Description copied from interface: VisitAcceptor
        Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.
        Specified by:
        acceptVisit in interface VisitAcceptor
      • getLength

        int getLength()
      • read

        void read​(java.io.DataInput in)
           throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        private void read​(Annotation.Property.Value val,
                          int tag,
                          java.io.DataInput in)
                   throws java.io.IOException
        Read data into the given value.
        Throws:
        java.io.IOException
      • write

        void write​(java.io.DataOutput out)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        private void write​(Annotation.Property.Value val,
                           java.io.DataOutput out)
                    throws java.io.IOException
        Write the data for the given value to the stream.
        Throws:
        java.io.IOException