Errai 3.0.1-SNAPSHOT

org.jboss.errai
Class BoringClassGenerator

java.lang.Object
  extended by 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

Constructor Summary
BoringClassGenerator(Pattern hiddenClassNamePattern, boolean debug)
           
 
Method Summary
 byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
          Generates a class with a no-args public constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoringClassGenerator

public BoringClassGenerator(Pattern hiddenClassNamePattern,
                            boolean debug)
Method Detail

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

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.