Class DecoupledTemplateLogic


  • public final class DecoupledTemplateLogic
    extends java.lang.Object

    This class specifies containers for decoupled template logic, normally coming from separate template files (decoupled templates).

    Instances of this class are built and populated by instances of DecoupledTemplateLogicBuilderMarkupHandler, acting as handlers on the IMarkupParser being used for parsing the normal template resources.

    Once built and populated, instances of this class are handled over to TemplateHandlerAdapterMarkupHandler instances which are one of the steps in the template parsing chain (converting parser events into ITemplateHandler events). Attributes specified here to be injected into the template are injected at real-time during the parsing operation itself, so that overhead is minimal (and zero once the template is cached).

    Instances of this class are not thread-safe.

    Since:
    3.0.0
    • Field Detail

      • injectedAttributes

        private final java.util.Map<java.lang.String,​java.util.List<DecoupledInjectedAttribute>> injectedAttributes
    • Constructor Detail

      • DecoupledTemplateLogic

        public DecoupledTemplateLogic()
    • Method Detail

      • hasInjectedAttributes

        public boolean hasInjectedAttributes()
      • getAllInjectedAttributeSelectors

        public java.util.Set<java.lang.String> getAllInjectedAttributeSelectors()
      • getInjectedAttributesForSelector

        public java.util.List<DecoupledInjectedAttribute> getInjectedAttributesForSelector​(java.lang.String selector)
      • addInjectedAttribute

        public void addInjectedAttribute​(java.lang.String selector,
                                         DecoupledInjectedAttribute injectedAttribute)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object