org.apache.bcel.classfile

## Class BootstrapMethod

- java.lang.Object
- - org.apache.bcel.classfile.BootstrapMethod

- All Implemented Interfaces:
    Cloneable

      public class BootstrapMethod
      extends Object
      implements Cloneable

  This class represents a bootstrap method attribute, i.e., the bootstrap method ref, the number of bootstrap arguments and an array of the bootstrap arguments.
  Since:
    6.0
  See Also:
    The class File Format : The BootstrapMethods Attribute

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BootstrapMethod(BootstrapMethod c)` Initialize from another object.
    `BootstrapMethod(int bootstrap_method_ref, int[] bootstrap_arguments)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BootstrapMethod` | `copy()`
    `void` | `dump(DataOutputStream file)` Dump object to file stream in binary format.
    `int[]` | `getBootstrapArguments()`
    `int` | `getBootstrapMethodRef()`
    `int` | `getNumBootstrapArguments()`
    `void` | `setBootstrapArguments(int[] bootstrap_arguments)`
    `void` | `setBootstrapMethodRef(int bootstrap_method_ref)`
    `String` | `toString()`
    `String` | `toString(ConstantPool constant_pool)`

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

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

- - ### Constructor Detail

    - #### BootstrapMethod

          public BootstrapMethod(BootstrapMethod c)

      Initialize from another object.

    - #### BootstrapMethod

          public BootstrapMethod(int bootstrap_method_ref,
                                 int[] bootstrap_arguments)

      Parameters:
        `bootstrap_method_ref` - int index into constant_pool of CONSTANT_MethodHandle
        `bootstrap_arguments` - int[] indices into constant_pool of CONSTANT_[type]_info

  - ### Method Detail

    - #### getBootstrapMethodRef

          public int getBootstrapMethodRef()

      Returns:
        index into constant_pool of bootstrap_method

    - #### setBootstrapMethodRef

          public void setBootstrapMethodRef(int bootstrap_method_ref)

      Parameters:
        `bootstrap_method_ref` - int index into constant_pool of CONSTANT_MethodHandle

    - #### getBootstrapArguments

          public int[] getBootstrapArguments()

      Returns:
        int[] of bootstrap_method indices into constant_pool of CONSTANT_[type]_info

    - #### getNumBootstrapArguments

          public int getNumBootstrapArguments()

      Returns:
        count of number of boostrap arguments

    - #### setBootstrapArguments

          public void setBootstrapArguments(int[] bootstrap_arguments)

      Parameters:
        `bootstrap_arguments` - int[] indices into constant_pool of CONSTANT_[type]_info

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`
      Returns:
        String representation.

    - #### toString

          public final String toString(ConstantPool constant_pool)

      Returns:
        Resolved string representation

    - #### dump

          public final void dump(DataOutputStream file)
                          throws IOException

      Dump object to file stream in binary format.
      Parameters:
        `file` - Output file stream
      Throws:
        `IOException`

    - #### copy

          public BootstrapMethod copy()

      Returns:
        deep copy of this object

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