org.apache.bcel.generic

## Class SimpleElementValueGen

- java.lang.Object
- - org.apache.bcel.generic.ElementValueGen
  - - org.apache.bcel.generic.SimpleElementValueGen

-     public class SimpleElementValueGen
      extends ElementValueGen

  Since:
    6.0

- - ### Field Summary

    - ### Fields inherited from class org.apache.bcel.generic.ElementValueGen

      `ANNOTATION, ARRAY, CLASS, cpGen, ENUM_CONSTANT, PRIMITIVE_BOOLEAN, PRIMITIVE_BYTE, PRIMITIVE_CHAR, PRIMITIVE_DOUBLE, PRIMITIVE_FLOAT, PRIMITIVE_INT, PRIMITIVE_LONG, PRIMITIVE_SHORT, STRING, type`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, boolean value)`
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, byte value)`
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, char value)`
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, double value)`
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, float value)`
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, int value)`
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, long value)`
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, short value)`
    `` | `SimpleElementValueGen(int type, ConstantPoolGen cpGen, String value)`
    `protected` | `SimpleElementValueGen(int type, int idx, ConstantPoolGen cpGen)` Protected ctor used for deserialization, doesn't *put* an entry in the constant pool, assumes the one at the supplied index is correct.
    `` | `SimpleElementValueGen(SimpleElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)` The boolean controls whether we copy info from the 'old' constant pool to the 'new'.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dump(DataOutputStream dos)`
    `ElementValue` | `getElementValue()` Return immutable variant
    `int` | `getIndex()`
    `int` | `getValueInt()`
    `String` | `getValueString()`
    `String` | `stringifyValue()`

    - ### Methods inherited from class org.apache.bcel.generic.ElementValueGen

      `copy, getConstantPool, getElementValueType, readElementValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleElementValueGen

          protected SimpleElementValueGen(int type,
                                          int idx,
                                          ConstantPoolGen cpGen)

      Protected ctor used for deserialization, doesn't *put* an entry in the constant pool, assumes the one at the supplied index is correct.

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       int value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       long value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       double value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       float value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       short value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       byte value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       char value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       boolean value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(int type,
                                       ConstantPoolGen cpGen,
                                       String value)

    - #### SimpleElementValueGen

          public SimpleElementValueGen(SimpleElementValue value,
                                       ConstantPoolGen cpool,
                                       boolean copyPoolEntries)

      The boolean controls whether we copy info from the 'old' constant pool to the 'new'. You need to use this ctor if the annotation is being copied from one file to another.

  - ### Method Detail

    - #### getElementValue

          public ElementValue getElementValue()

      Return immutable variant
      Specified by:
        `getElementValue` in class `ElementValueGen`

    - #### getIndex

          public int getIndex()

    - #### getValueString

          public String getValueString()

    - #### getValueInt

          public int getValueInt()

    - #### stringifyValue

          public String stringifyValue()

      Specified by:
        `stringifyValue` in class `ElementValueGen`

    - #### dump

          public void dump(DataOutputStream dos)
                    throws IOException

      Specified by:
        `dump` in class `ElementValueGen`
      Throws:
        `IOException`

Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.