Class FieldAugmentationProcessor

java.lang.Object
com.broadleafcommerce.metadata.core.service.processor.FieldAugmentationProcessor
All Implemented Interfaces:
AugmentationProcessor
Direct Known Subclasses:
SelectFieldAugmentationProcessor

@Order(10000) public class FieldAugmentationProcessor extends Object implements AugmentationProcessor
This processor is used to insert or update the fields.
Author:
Dima Myroniuk (dmyroniuk)
  • Constructor Details

    • FieldAugmentationProcessor

      public FieldAugmentationProcessor(com.fasterxml.jackson.databind.ObjectMapper mapper)
  • Method Details

    • canHandleInsert

      public boolean canHandleInsert(com.broadleafcommerce.metadata.dsl.core.Component<?> parent, Augmentation augmentation)
      Description copied from interface: AugmentationProcessor
      Check if this service can process the augmentation for the AugmentationChangeType.INSERT change.
      Specified by:
      canHandleInsert in interface AugmentationProcessor
      Parameters:
      parent - the parent component to insert the augmented component
      augmentation - the augmentation to apply
      Returns:
      true if this processor can process the augmentation
    • canHandleUpdate

      public boolean canHandleUpdate(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)
      Description copied from interface: AugmentationProcessor
      Check if this service can process the augmentation for the AugmentationChangeType.PATCH change.
      Specified by:
      canHandleUpdate in interface AugmentationProcessor
      Parameters:
      component - the component to update with the specified augmentation
      augmentation - the augmentation to apply
      Returns:
      true if this processor can process the augmentation
    • processInsert

      public com.broadleafcommerce.metadata.dsl.core.Component<?> processInsert(com.broadleafcommerce.metadata.dsl.core.Component<?> parent, Augmentation augmentation)
      Description copied from interface: AugmentationProcessor
      Adds the new component to the specified parent component.
      Specified by:
      processInsert in interface AugmentationProcessor
      Parameters:
      parent - the parent component to insert the new component
      augmentation - the augmentation to apply
      Returns:
      the inserted component
    • processUpdate

      public com.broadleafcommerce.metadata.dsl.core.Component<?> processUpdate(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)
      Description copied from interface: AugmentationProcessor
      Updates the specified component.
      Specified by:
      processUpdate in interface AugmentationProcessor
      Parameters:
      component - the component to update
      augmentation - the augmentation to apply
      Returns:
      the updated component
    • getFieldAugmentationPayload

      protected FieldAugmentationPayload getFieldAugmentationPayload(Augmentation augmentation)
    • applyAugmentation

      protected void applyAugmentation(com.broadleafcommerce.metadata.dsl.core.Field<?> field, FieldAugmentationPayload fieldPayload)
    • buildValidationSchema

      protected com.broadleafcommerce.metadata.dsl.core.extension.fields.validation.AbstractValidationSchema<?> buildValidationSchema(@NonNull @NonNull ValidationSchemaAugmentationPayload validationPayload)
    • buildValidationMethod

      protected com.broadleafcommerce.metadata.dsl.core.ValidationMethod<?> buildValidationMethod(@NonNull @NonNull ValidationMethodAugmentationPayload methodPayload)
    • getMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • setTypeFactory

      @Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)