Class DefaultMustache

    • Field Detail

      • codes

        private Code[] codes
      • inited

        private boolean inited
      • isRecursive

        private boolean isRecursive
    • Method Detail

      • run

        public java.io.Writer run​(java.io.Writer writer,
                                  java.util.List<java.lang.Object> scopes)
        Description copied from interface: Mustache
        Only executes the codes. Does not append the text.
        Specified by:
        run in interface Mustache
        Overrides:
        run in class DefaultCode
        Parameters:
        writer - write the output of the executed template here
        scopes - the array of scopes to execute
        Returns:
        the replacement writer
      • invert

        public Node invert​(java.lang.String text)
        Description copied from interface: Mustache
        Invert this mustache given output text.
        Specified by:
        invert in interface Mustache
        Parameters:
        text - the text to parse
        Returns:
        a tree of nodes representing the variables that when passed as a scope would reproduce the text
      • setCodes

        public void setCodes​(Code[] newcodes)
        Description copied from interface: Mustache
        Change the underlying codes of the mustache implementation.
        Specified by:
        setCodes in interface Code
        Specified by:
        setCodes in interface Mustache
        Overrides:
        setCodes in class DefaultCode
        Parameters:
        newcodes - set the children of this code
      • execute

        public java.io.Writer execute​(java.io.Writer writer,
                                      java.util.List<java.lang.Object> scopes)
        Description copied from class: DefaultCode
        The default behavior is to run the codes and append the captured text.
        Specified by:
        execute in interface Code
        Specified by:
        execute in interface Mustache
        Overrides:
        execute in class DefaultCode
        Parameters:
        writer - The writer to write the output to
        scopes - The scopes to evaluate the embedded names against.
        Returns:
        the new writer
      • identity

        public void identity​(java.io.Writer writer)
        Description copied from interface: Mustache
        Execute the mustache to output itself.
        Specified by:
        identity in interface Code
        Specified by:
        identity in interface Mustache
        Overrides:
        identity in class DefaultCode
        Parameters:
        writer - write the output of the executed template here
      • init

        public void init()
        Description copied from interface: Mustache
        Initialize the mustache before executing. This is must be called at least once and is normally called already by the time you have a mustache instance.
        Specified by:
        init in interface Code
        Specified by:
        init in interface Mustache
        Overrides:
        init in class DefaultCode
      • isRecursive

        public boolean isRecursive()
      • setRecursive

        public void setRecursive()