org.shiftone.jrat.inject.bytecode
Interface InjectorStrategy

All Known Implementing Classes:
AsmInjectorStrategy

public interface InjectorStrategy

JRat can swap out bytecode manipulation libraries - each supported library must have a InjectorStrategy implementation.

Author:
jeff@shiftone.org (Jeff Drost)

Field Summary
static java.lang.String COMMENT_FIELD_NAME
           
static java.lang.String HANDLER_PREFIX
           
static java.lang.String METHOD_POSTFIX
          when a class is injected, a magic field is added that contains a comment.
 
Method Summary
 byte[] inject(byte[] inputClassData, TransformerOptions options)
          this method takes a byte array containing the data of a class, transforms the class, and returns a new byte array containing the data of a transformed / injected class.
 

Field Detail

METHOD_POSTFIX

static final java.lang.String METHOD_POSTFIX
when a class is injected, a magic field is added that contains a comment. this field's existance tells the injector that "jrat was here".

See Also:
Constant Field Values

HANDLER_PREFIX

static final java.lang.String HANDLER_PREFIX
See Also:
Constant Field Values

COMMENT_FIELD_NAME

static final java.lang.String COMMENT_FIELD_NAME
See Also:
Constant Field Values
Method Detail

inject

byte[] inject(byte[] inputClassData,
              TransformerOptions options)
              throws java.lang.Exception
this method takes a byte array containing the data of a class, transforms the class, and returns a new byte array containing the data of a transformed / injected class.

Throws:
java.lang.Exception