org.jboss.errai
Class BoringClassGenerator
java.lang.Object
org.jboss.errai.BoringClassGenerator
- All Implemented Interfaces:
- ClassFileTransformer
public class BoringClassGenerator
- extends Object
- implements ClassFileTransformer
A class file "transformer" that ignores the original class definition,
instead generating a class that is completely boring: a trivial public
subclass of java.lang.Object which is in the expected package and has the
expected name.
- Author:
- Jonathan Fuerth
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoringClassGenerator
public BoringClassGenerator(Pattern hiddenClassNamePattern,
boolean debug)
transform
public byte[] transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer)
throws IllegalClassFormatException
- Generates a class with a no-args public constructor.
- Specified by:
transform
in interface ClassFileTransformer
- Parameters:
loader
- ignored.className
- The generated class has this package and name.classBeingRedefined
- ignored.protectionDomain
- ignored.classfileBuffer
- ignored.
- Returns:
- bytecode for an empty class whose package and class name are
determined by the
className
parameter.
- Throws:
IllegalClassFormatException
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.