Class SelectFieldAugmentationProcessor
java.lang.Object
com.broadleafcommerce.metadata.core.service.processor.FieldAugmentationProcessor
com.broadleafcommerce.metadata.core.service.processor.SelectFieldAugmentationProcessor
- All Implemented Interfaces:
AugmentationProcessor
This processor is used to insert or update the fields with type
FieldTypes.SELECT
.- Author:
- Dima Myroniuk (dmyroniuk)
-
Constructor Summary
ConstructorsConstructorDescriptionSelectFieldAugmentationProcessor
(com.fasterxml.jackson.databind.ObjectMapper mapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyAugmentation
(com.broadleafcommerce.metadata.dsl.core.Field<?> field, FieldAugmentationPayload fieldPayload) 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.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.protected void
setOptions
(com.broadleafcommerce.metadata.dsl.core.extension.fields.SelectField<?> field, FieldAugmentationPayload fieldPayload) Methods inherited from class com.broadleafcommerce.metadata.core.service.processor.FieldAugmentationProcessor
buildValidationMethod, buildValidationSchema, getFieldAugmentationPayload, getMapper, getTypeFactory, setTypeFactory
-
Constructor Details
-
SelectFieldAugmentationProcessor
public SelectFieldAugmentationProcessor(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 theAugmentationChangeType.INSERT
change.- Specified by:
canHandleInsert
in interfaceAugmentationProcessor
- Overrides:
canHandleInsert
in classFieldAugmentationProcessor
- 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
- Overrides:
canHandleUpdate
in classFieldAugmentationProcessor
- 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
- Overrides:
processInsert
in classFieldAugmentationProcessor
- 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
- Overrides:
processUpdate
in classFieldAugmentationProcessor
- Parameters:
component
- the component to updateaugmentation
- the augmentation to apply- Returns:
- the updated component
-
applyAugmentation
protected void applyAugmentation(com.broadleafcommerce.metadata.dsl.core.Field<?> field, FieldAugmentationPayload fieldPayload) - Overrides:
applyAugmentation
in classFieldAugmentationProcessor
-
setOptions
protected void setOptions(com.broadleafcommerce.metadata.dsl.core.extension.fields.SelectField<?> field, FieldAugmentationPayload fieldPayload)
-