org.springframework.asm

Class ConstantDynamic

  • java.lang.Object
    • org.springframework.asm.ConstantDynamic


  • public final class ConstantDynamic
    extends java.lang.Object
    A constant whose value is computed at runtime, with a bootstrap method.
    Author:
    Remi Forax
    • Constructor Summary

      Constructors 
      Constructor and Description
      ConstantDynamic(java.lang.String name, java.lang.String descriptor, Handle bootstrapMethod, java.lang.Object... bootstrapMethodArguments)
      Constructs a new ConstantDynamic.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object object) 
      Handle getBootstrapMethod()
      Returns the bootstrap method used to compute the value of this constant.
      java.lang.Object[] getBootstrapMethodArguments()
      Returns the arguments to pass to the bootstrap method, in order to compute the value of this constant.
      java.lang.String getDescriptor()
      Returns the type of this constant.
      java.lang.String getName()
      Returns the name of this constant.
      int getSize()
      Returns the size of this constant.
      int hashCode() 
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ConstantDynamic

        public ConstantDynamic(java.lang.String name,
                               java.lang.String descriptor,
                               Handle bootstrapMethod,
                               java.lang.Object... bootstrapMethodArguments)
        Constructs a new ConstantDynamic.
        Parameters:
        name - the constant name (can be arbitrary).
        descriptor - the constant type (must be a field descriptor).
        bootstrapMethod - the bootstrap method to use to compute the constant value at runtime.
        bootstrapMethodArguments - the arguments to pass to the bootstrap method, in order to compute the constant value at runtime.
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of this constant.
        Returns:
        the name of this constant.
      • getDescriptor

        public java.lang.String getDescriptor()
        Returns the type of this constant.
        Returns:
        the type of this constant, as a field descriptor.
      • getBootstrapMethod

        public Handle getBootstrapMethod()
        Returns the bootstrap method used to compute the value of this constant.
        Returns:
        the bootstrap method used to compute the value of this constant.
      • getBootstrapMethodArguments

        public java.lang.Object[] getBootstrapMethodArguments()
        Returns the arguments to pass to the bootstrap method, in order to compute the value of this constant.
        Returns:
        the arguments to pass to the bootstrap method, in order to compute the value of this constant.
      • getSize

        public int getSize()
        Returns the size of this constant.
        Returns:
        the size of this constant, i.e., 2 for long and double, 1 otherwise.
      • equals

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

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

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