public interface BroadleafTagReplacementProcessor extends BroadleafProcessor
A tag processor that's used to replace the tag that it was triggered on with a BroadleafTemplateModel. This allows implementations to
completely replace the element that invokes this with a brand new DOM (usually HTML).
For example, given an implementation of this tag that is invoked like this in the template:
<blc:output_javascript message="This is some Javascript"/>
A processor that implements this interface would replace that with a brand new model like:
<script type="text/javascript>
console.log("This is some Javscript");
</script>
This differs from the BroadleafModelModifierProcessor in that this BroadleafTagReplacementProcessor completely replaces the tag with a new model
while the BroadleafModelModifierProcessor is designed to augment the originally-written dom.
DEFAULT_PRECEDENCE, DEFAULT_PREFIX| Modifier and Type | Method and Description |
|---|---|
BroadleafTemplateModel |
getReplacementModel(String tagName,
Map<String,String> tagAttributes,
BroadleafTemplateContext context) |
boolean |
replacementNeedsProcessing() |
getName, getPrecedence, getPrefixboolean replacementNeedsProcessing()
BroadleafTemplateModel from the given BroadleafTemplateContext have additional expressions or includes that
are template-processing specific (e.g. extra includes, addition of new variables in the tags, etc).BroadleafTemplateModel getReplacementModel(String tagName, Map<String,String> tagAttributes, BroadleafTemplateContext context)
tagName - The name of the tag the event was triggered ontagAttributes - A map of String to String of all of the attributes on the tagcontext - The BroadleafTemplateContext that should be used to perform operations on the tag withBroadleafTemplateModel that should replace the tag that the event was triggered onCopyright © 2022. All rights reserved.