001 package org.shiftone.jrat.inject.bytecode;
002
003
004 /**
005 * JRat can swap out bytecode manipulation libraries - each supported library
006 * must have a InjectorStrategy implementation.
007 *
008 * @author jeff@shiftone.org (Jeff Drost)
009 */
010 public interface InjectorStrategy {
011
012 /**
013 * when a class is injected, a magic field is added that contains a comment.
014 * this field's existance tells the injector that "jrat was here".
015 */
016 public static final String METHOD_POSTFIX = "_$jrat";
017 public static final String HANDLER_PREFIX = "jrat$";
018 public static final String COMMENT_FIELD_NAME = "$hiftOne_JRat_was_here";
019
020 /**
021 * this method takes a byte array containing the data of a class, transforms
022 * the class, and returns a new byte array containing the data of a
023 * transformed / injected class.
024 */
025 byte[] inject(byte[] inputClassData, TransformerOptions options) throws Exception;
026 }