Class FileTag
java.lang.Object
org.apache.commons.jelly.TagSupport
org.apache.commons.jelly.tags.core.FileTag
- All Implemented Interfaces:
Tag
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
-
Field Summary
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, parent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected XMLOutput
createXMLOutput
(Writer writer) A Factory method to create a new XMLOutput from the given Writer.void
Evaluates this tag after all the tags properties have been initialized.getVar()
Returns the var.void
setAppend
(boolean doAppend) Sets wether to append at the end of the file (not really something you normally do with an XML file).void
setEncoding
(String encoding) Sets the XML encoding mode, which defaults to UTF-8void
Sets the file name for the outputvoid
setOmitXmlDeclaration
(boolean omitXmlDeclaration) Sets whether the XML declaration should be output or notvoid
setOutputMode
(String outputMode) Sets the output mode, whether XML or HTMLvoid
setPrettyPrint
(boolean prettyPrint) Sets whether pretty printing mode is turned on.void
Sets the var.protected void
Writes the body fo this tag to the given WriterMethods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
-
Constructor Details
-
FileTag
public FileTag()
-
-
Method Details
-
doTag
Description copied from interface:Tag
Evaluates this tag after all the tags properties have been initialized.- Throws:
JellyTagException
-
setName
Sets the file name for the output -
setOmitXmlDeclaration
public void setOmitXmlDeclaration(boolean omitXmlDeclaration) Sets whether the XML declaration should be output or not -
setOutputMode
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
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
Returns the var.- Returns:
- String
-
setVar
Sets the var.- Parameters:
var
- The var to set
-
writeBody
Writes the body fo this tag to the given Writer- Throws:
SAXException
JellyTagException
-
createXMLOutput
A Factory method to create a new XMLOutput from the given Writer.
-