Class ExternalAugmentationProcessor
java.lang.Object
com.broadleafcommerce.metadata.core.service.processor.ExternalAugmentationProcessor
- All Implemented Interfaces:
AugmentationProcessor
@Order(10000)
public class ExternalAugmentationProcessor
extends Object
implements AugmentationProcessor
This processor is used to insert or update the fields.
-
Constructor Summary
ConstructorsConstructorDescriptionExternalAugmentationProcessor
(com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyAugmentation
(com.broadleafcommerce.metadata.dsl.core.External<?> field, FieldAugmentationPayload fieldPayload) protected com.broadleafcommerce.metadata.dsl.core.ValidationMethod<?>
buildValidationMethod
(@NonNull ValidationMethodAugmentationPayload methodPayload) protected com.broadleafcommerce.metadata.dsl.core.extension.fields.validation.AbstractValidationSchema<?>
buildValidationSchema
(@NonNull ValidationSchemaAugmentationPayload validationPayload) boolean
canHandleInsert
(com.broadleafcommerce.metadata.dsl.core.Component<?> parent, Augmentation augmentation) Check if this service can process the augmentation for theAugmentationChangeType.INSERT
change.boolean
canHandleUpdate
(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation) Check if this service can process the augmentation for theAugmentationChangeType.PATCH
change.protected FieldAugmentationPayload
getFieldAugmentationPayload
(Augmentation augmentation) protected com.fasterxml.jackson.databind.ObjectMapper
protected com.broadleafcommerce.common.extension.TypeFactory
com.broadleafcommerce.metadata.dsl.core.Component<?>
processInsert
(com.broadleafcommerce.metadata.dsl.core.Component<?> parent, Augmentation augmentation) Adds the new component to the specified parent component.com.broadleafcommerce.metadata.dsl.core.Component<?>
processUpdate
(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation) Updates the specified component.
-
Constructor Details
-
ExternalAugmentationProcessor
public ExternalAugmentationProcessor(com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
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 theAugmentationChangeType.INSERT
change.- Specified by:
canHandleInsert
in interfaceAugmentationProcessor
- Parameters:
parent
- the parent component to insert the augmented componentaugmentation
- 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 theAugmentationChangeType.PATCH
change.- Specified by:
canHandleUpdate
in interfaceAugmentationProcessor
- Parameters:
component
- the component to update with the specified augmentationaugmentation
- 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 interfaceAugmentationProcessor
- Parameters:
parent
- the parent component to insert the new componentaugmentation
- 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 interfaceAugmentationProcessor
- Parameters:
component
- the component to updateaugmentation
- the augmentation to apply- Returns:
- the updated component
-
getFieldAugmentationPayload
-
applyAugmentation
protected void applyAugmentation(com.broadleafcommerce.metadata.dsl.core.External<?> 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()
-