Interface BroadleafModelModifierProcessor

All Superinterfaces:
BroadleafProcessor
All Known Implementing Classes:
AbstractBroadleafModelModifierProcessor

public interface BroadleafModelModifierProcessor extends BroadleafProcessor

A tag processor that changes the tag to the tagName specified in the BroadleafTemplateModelModifierDTO, adds attributes to that tag, adds local variables to that tag, and adds a BroadleafTemplateModel as the last child of the tag.

This processor is similar to the BroadleafTagReplacementProcessor in that it modifies the DOM model. This processor is different in that it is designed to keep the majority of the originally-written model intact and instead augment it with additional elements, tags, etc.

Author:
Jay Aisenbrey (cja769)
See Also:
  • Method Details

    • useSingleQuotes

      boolean useSingleQuotes()
      Returns:
      true if the attribute values on the tag should be surrounded by single quotes or false if they should be surrounded by double quotes
    • reprocessModel

      boolean reprocessModel()
      Returns:
      true if the model inserted as the last child should be reprocessed because it contains template logic or false if it shoudn't
    • getInjectedModelAndTagAttributes

      BroadleafTemplateModelModifierDTO getInjectedModelAndTagAttributes(String rootTagName, Map<String,String> rootTagAttributes, BroadleafTemplateContext context)
      Parameters:
      rootTagName - The name of the tag the event was triggered on
      rootTagAttributes - A map of String to String of all of the attributes on the tag
      context - The BroadleafTemplateContext that should be used to perform operations on the tag with
      Returns:
      A BroadleafTemplateModelModifierDTO that has the parameters that should be added to the tag, the model variables that should be added to the local model and the BroadleafTemplateModel that should be added as the last child of the tag