Class MetaDataBytecodeTransformer

java.lang.Object
rife.validation.instrument.MetaDataBytecodeTransformer

public abstract class MetaDataBytecodeTransformer extends Object
This utility class provides an entrance method to modify the bytecode of a class so that metadata from a sibling class is merged into the first class.

Basically, this automatically creates an instance of the metadata class and stores it as a field of the modified class. All the interfaces of the metadata class are also automatically implemented by the modified class by delegating all the method calls to the added field instance.

WARNING: this class is not supposed to be used directly, it is made public since the RIFE2 agent has to be able to access it.

Since:
1.0
  • Constructor Details

    • MetaDataBytecodeTransformer

      public MetaDataBytecodeTransformer()
  • Method Details

    • mergeMetaDataIntoBytes

      public static byte[] mergeMetaDataIntoBytes(byte[] origBytes, Class metaData)
      Performs the actual merging of the metadata class' functionalities into the bytes of the class that were provided.
      Parameters:
      origBytes - the bytes that have to be modied
      metaData - the metadata classes that will be merged into it
      Returns:
      the modified bytes
      Since:
      1.0