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 Details

    • moduleName

      protected String moduleName
    • classNames

      protected List<String> classNames
    • annotationClass

      protected String annotationClass
    • conditionalPropertyName

      protected String conditionalPropertyName
    • beanFactory

      protected org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory
  • Constructor Details

    • RemoveAnnotationClassTransformer

      public RemoveAnnotationClassTransformer(String moduleName)
  • Method Details

    • compileJPAProperties

      public void compileJPAProperties(Properties props, Object key) throws Exception
      Specified by:
      compileJPAProperties in interface BroadleafClassTransformer
      Throws:
      Exception
    • setBeanFactory

      public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      setBeanFactory in interface org.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:
      transform in interface jakarta.persistence.spi.ClassTransformer
      Throws:
      jakarta.persistence.spi.TransformerException
    • stripAnnotation

      protected javassist.bytecode.AnnotationsAttribute stripAnnotation(javassist.bytecode.ConstPool constantPool, List<?> attributes)
    • isPropertyEnabled

      protected Boolean isPropertyEnabled(String propertyName)
    • getClassNames

      public List<String> getClassNames()
      The list of fully-qualified classes to be impacted by this transformer
      Returns:
    • setClassNames

      public void setClassNames(List<String> classNames)
    • getAnnotationClass

      public String getAnnotationClass()
      The fully-qualified classname of the annotation to remove at the class and field level
      Returns:
    • setAnnotationClass

      public void setAnnotationClass(String annotationClass)
    • getConditionalPropertyName

      public String 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

      public void setConditionalPropertyName(String conditionalPropertyName)