Class RemoveAnnotationClassTransformer
java.lang.Object
org.broadleafcommerce.common.extensibility.jpa.copy.AbstractClassTransformer
org.broadleafcommerce.common.extensibility.jpa.copy.RemoveAnnotationClassTransformer
- All Implemented Interfaces:
jakarta.persistence.spi.ClassTransformer,BroadleafClassTransformer,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.InitializingBean
public class RemoveAnnotationClassTransformer
extends AbstractClassTransformer
implements BroadleafClassTransformer, org.springframework.beans.factory.BeanFactoryAware
Strip a candidate annotation from candidate classes and their fields.
- Author:
- Jeff Fischer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected org.springframework.beans.factory.config.ConfigurableBeanFactoryprotected Stringprotected StringFields inherited from class org.broadleafcommerce.common.extensibility.jpa.copy.AbstractClassTransformer
alreadyLoadedClasses, preLoadClassNamePatterns -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompileJPAProperties(Properties props, Object key) The fully-qualified classname of the annotation to remove at the class and field levelThe list of fully-qualified classes to be impacted by this transformerOptional property to declare to gate the activity of this instance of the class tranformer.protected BooleanisPropertyEnabled(String propertyName) voidsetAnnotationClass(String annotationClass) voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) voidsetClassNames(List<String> classNames) voidsetConditionalPropertyName(String conditionalPropertyName) protected javassist.bytecode.AnnotationsAttributestripAnnotation(javassist.bytecode.ConstPool constantPool, List<?> attributes) byte[]transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) Methods inherited from class org.broadleafcommerce.common.extensibility.jpa.copy.AbstractClassTransformer
afterPropertiesSet, setPreLoadClassNamePatterns
-
Field Details
-
moduleName
-
classNames
-
annotationClass
-
conditionalPropertyName
-
beanFactory
protected org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory
-
-
Constructor Details
-
RemoveAnnotationClassTransformer
-
-
Method Details
-
compileJPAProperties
- Specified by:
compileJPAPropertiesin interfaceBroadleafClassTransformer- Throws:
Exception
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
transform
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws jakarta.persistence.spi.TransformerException - Specified by:
transformin interfacejakarta.persistence.spi.ClassTransformer- Throws:
jakarta.persistence.spi.TransformerException
-
stripAnnotation
protected javassist.bytecode.AnnotationsAttribute stripAnnotation(javassist.bytecode.ConstPool constantPool, List<?> attributes) -
isPropertyEnabled
-
getClassNames
The list of fully-qualified classes to be impacted by this transformer- Returns:
-
setClassNames
-
getAnnotationClass
The fully-qualified classname of the annotation to remove at the class and field level- Returns:
-
setAnnotationClass
-
getConditionalPropertyName
Optional property to declare to gate the activity of this instance of the class tranformer. If a property is specified, and it does not exist or is set to "false", the class transformation will be skipped.- Returns:
-
setConditionalPropertyName
-