Class DefaultAugmentationProvider
- java.lang.Object
-
- com.broadleafcommerce.metadata.core.service.DefaultAugmentationProvider
-
- All Implemented Interfaces:
AugmentationProvider
@Order(0) public class DefaultAugmentationProvider extends Object implements AugmentationProvider
The primary provider for fetching and applying `Augmentation` domain on top of view container metadata. This provider handles augmentation by applying the `Augmentation` in order of creation and according to their `AugmentationChangeType` enum.- Author:
- Nick Crum (ncrum)
- See Also:
for the set of change type options
-
-
Field Summary
Fields Modifier and Type Field Description static StringTARGET_KEY_REGEX
-
Constructor Summary
Constructors Constructor Description DefaultAugmentationProvider(AugmentationService<Augmentation> augmentationService, List<AugmentationProcessor> augmentationProcessors, com.fasterxml.jackson.databind.ObjectMapper mapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyQueryBuilderAugmentations(com.broadleafcommerce.metadata.dsl.core.Component<?> container, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)AugmentedContaineraugment(com.broadleafcommerce.metadata.dsl.core.Component<?> container, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Augments the provided `ViewComponent` with additional properties.protected com.broadleafcommerce.metadata.dsl.core.Component<?>augment(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)Augments the given component according to the given augmentation.protected booleanaugmentationApplied(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)protected voidaugmentChildActions(Map<String,com.broadleafcommerce.metadata.dsl.core.Action<?>> actions, Augmentation augmentation)protected voidaugmentChildComponents(Map<String,com.broadleafcommerce.metadata.dsl.core.Component<?>> components, Augmentation augmentation)protected @NotNull com.broadleafcommerce.metadata.dsl.core.Field<?>buildQueryBuilderField(com.broadleafcommerce.metadata.dsl.core.extension.BuilderFieldSource<?> component, Augmentation augmentation, FieldAugmentationPayload payload)protected @NotNull List<Augmentation>getAugmentations(String containerKey, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected FieldAugmentationPayloadgetFieldAugmentationPayload(Augmentation augmentation)protected @NotNull List<Augmentation>getQueryBuilderAugmentations(String containerKey, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected voidprocessQueryBuilderAugmentation(com.broadleafcommerce.metadata.dsl.core.Component<?> component, com.broadleafcommerce.metadata.dsl.core.extension.BuilderFieldSource<?> fieldSource, Augmentation augmentation)protected voidremoveQueryBuilderField(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)
-
-
-
Field Detail
-
TARGET_KEY_REGEX
public static final String TARGET_KEY_REGEX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultAugmentationProvider
public DefaultAugmentationProvider(AugmentationService<Augmentation> augmentationService, List<AugmentationProcessor> augmentationProcessors, com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Detail
-
augment
public AugmentedContainer augment(com.broadleafcommerce.metadata.dsl.core.Component<?> container, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:AugmentationProviderAugments the provided `ViewComponent` with additional properties.- Specified by:
augmentin interfaceAugmentationProvider- Parameters:
container- the view container component- Returns:
- the mutated `ViewComponent`
-
applyQueryBuilderAugmentations
protected void applyQueryBuilderAugmentations(com.broadleafcommerce.metadata.dsl.core.Component<?> container, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
getAugmentations
@NotNull protected @NotNull List<Augmentation> getAugmentations(String containerKey, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
getQueryBuilderAugmentations
@NotNull protected @NotNull List<Augmentation> getQueryBuilderAugmentations(String containerKey, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
processQueryBuilderAugmentation
protected void processQueryBuilderAugmentation(com.broadleafcommerce.metadata.dsl.core.Component<?> component, com.broadleafcommerce.metadata.dsl.core.extension.BuilderFieldSource<?> fieldSource, Augmentation augmentation)
-
removeQueryBuilderField
protected void removeQueryBuilderField(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)
-
buildQueryBuilderField
@NotNull protected @NotNull com.broadleafcommerce.metadata.dsl.core.Field<?> buildQueryBuilderField(com.broadleafcommerce.metadata.dsl.core.extension.BuilderFieldSource<?> component, Augmentation augmentation, FieldAugmentationPayload payload)
-
getFieldAugmentationPayload
protected FieldAugmentationPayload getFieldAugmentationPayload(Augmentation augmentation)
-
augmentationApplied
protected boolean augmentationApplied(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)
-
augment
@Nullable protected com.broadleafcommerce.metadata.dsl.core.Component<?> augment(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)Augments the given component according to the given augmentation. This returns a new instance representing the augmented component, the original component passed in is unchanged- Parameters:
component- the component to augmentaugmentation- the definition of the changes to apply to the component- Returns:
- a new component representing how this component was changed. null for
AugmentationChangeType.REMOVE
-
augmentChildComponents
protected void augmentChildComponents(Map<String,com.broadleafcommerce.metadata.dsl.core.Component<?>> components, Augmentation augmentation)
-
augmentChildActions
protected void augmentChildActions(Map<String,com.broadleafcommerce.metadata.dsl.core.Action<?>> actions, Augmentation augmentation)
-
-