Class FileTag

  • All Implemented Interfaces:
    Tag

    public class FileTag
    extends TagSupport
    A tag that pipes its body to a file denoted by the name attribute or to an in memory String which is then output to a variable denoted by the var variable.
    Author:
    Vinay Chandran
    • Constructor Detail

      • FileTag

        public FileTag()
    • Method Detail

      • setName

        public void setName​(String name)
        Sets the file name for the output
      • setOmitXmlDeclaration

        public void setOmitXmlDeclaration​(boolean omitXmlDeclaration)
        Sets whether the XML declaration should be output or not
      • setOutputMode

        public void setOutputMode​(String outputMode)
        Sets the output mode, whether XML or HTML
      • setPrettyPrint

        public void setPrettyPrint​(boolean prettyPrint)
        Sets whether pretty printing mode is turned on. The default is off so that whitespace is preserved
      • setEncoding

        public void setEncoding​(String encoding)
        Sets the XML encoding mode, which defaults to UTF-8
      • setAppend

        public void setAppend​(boolean doAppend)
        Sets wether to append at the end of the file (not really something you normally do with an XML file).
      • getVar

        public String getVar()
        Returns the var.
        Returns:
        String
      • setVar

        public void setVar​(String var)
        Sets the var.
        Parameters:
        var - The var to set
      • createXMLOutput

        protected XMLOutput createXMLOutput​(Writer writer)
        A Factory method to create a new XMLOutput from the given Writer.