Class 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
    • 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: AugmentationProvider
        Augments the provided `ViewComponent` with additional properties.
        Specified by:
        augment in interface AugmentationProvider
        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)
      • 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 augment
        augmentation - 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)