org.broadleafcommerce.common.extensibility.jpa.copy
Class AnnotationsCopyClassTransformer
java.lang.Object
org.broadleafcommerce.common.extensibility.jpa.copy.AnnotationsCopyClassTransformer
- All Implemented Interfaces:
- javax.persistence.spi.ClassTransformer, BroadleafClassTransformer
public class AnnotationsCopyClassTransformer
- extends Object
- implements BroadleafClassTransformer
This class transformer will copy fields, methods, and interface definitions from a source class to a target class,
based on the xformTemplates map. It will fail if it encouters any duplicate definitions.
- Author:
- Andre Azzolini (apazzolini)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected SupportLogger logger
moduleName
protected String moduleName
xformTemplates
protected Map<String,String> xformTemplates
transformedMethods
protected static List<String> transformedMethods
AnnotationsCopyClassTransformer
public AnnotationsCopyClassTransformer(String moduleName)
compileJPAProperties
public void compileJPAProperties(Properties props,
Object key)
throws Exception
- Specified by:
compileJPAProperties in interface BroadleafClassTransformer
- Throws:
Exception
transform
public byte[] transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer)
throws IllegalClassFormatException
- Specified by:
transform in interface javax.persistence.spi.ClassTransformer
- Throws:
IllegalClassFormatException
getImplementationType
protected String getImplementationType(String className)
- This method will do its best to return an implementation type for a given classname. This will allow weaving
template classes to have initialized values.
We provide default implementations for List, Map, and Set, and will attempt to utilize a default constructor for
other classes.
If the className contains an '[', we will return null.
methodDescription
protected String methodDescription(javassist.CtMethod method)
getXformTemplates
public Map<String,String> getXformTemplates()
setXformTemplates
public void setXformTemplates(Map<String,String> xformTemplates)
Copyright © 2013. All Rights Reserved.