Class LoadedTypeInitializer.ForStaticField

    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        This class's serial version UID.
        See Also:
        Constant Field Values
      • STATIC_FIELD

        private static final java.lang.Object STATIC_FIELD
        A value for accessing a static field.
      • fieldName

        private final java.lang.String fieldName
        The name of the field.
      • value

        private final java.lang.Object value
        The value of the field.
    • Constructor Detail

      • ForStaticField

        public ForStaticField​(java.lang.String fieldName,
                              java.lang.Object value)
        Creates a new LoadedTypeInitializer for setting a static field.
        Parameters:
        fieldName - the name of the field.
        value - The value to be set.
    • Method Detail

      • onLoad

        public void onLoad​(java.lang.Class<?> type)
        Callback that is invoked on the creation of an instrumented type. If the loaded type initializer is alive, this method should be implemented empty instead of throwing an exception.
        Specified by:
        onLoad in interface LoadedTypeInitializer
        Parameters:
        type - The manifestation of the instrumented type.
      • isAlive

        public boolean isAlive()
        Indicates if this initializer is alive and needs to be invoked. This is only meant as a mark. A loaded type initializer that is not alive might still be called and must therefore not throw an exception but rather provide an empty implementation.
        Specified by:
        isAlive in interface LoadedTypeInitializer
        Returns:
        true if this initializer is alive.