Class ParseTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- org.apache.commons.jelly.tags.core.ParseTag
-
- All Implemented Interfaces:
Tag
public class ParseTag extends TagSupport
Parses the output of this tags body or of a given String as a Jelly script then either outputting the Script as a variable or executing the script.- Version:
- $Revision: 406153 $
- Author:
- James Strachan
-
-
Field Summary
-
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, parent
-
-
Constructor Summary
Constructors Constructor Description ParseTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected XMLParser
createJellyParser()
Factory method to create a new Jelly parserprotected XMLReader
createXMLReader()
Factory method to create a new XMLReadervoid
doTag(XMLOutput output)
Evaluates this tag after all the tags properties have been initialized.XMLParser
getJellyParser()
String
getText()
Returns the text to be parsedString
getVar()
The variable name that will be used for the Document variable createdXMLReader
getXMLReader()
protected void
parseBody(XMLOutput output)
Parses the body of this tag and returns the parsed documentprotected void
parseText(String text)
Parses the give piece of text as being markupvoid
setJellyParser(XMLParser jellyParser)
Sets the jellyParser.void
setText(String text)
Sets the text to be parsed by this parservoid
setVar(String var)
Sets the variable name that will be used for the Document variable createdvoid
setXMLReader(XMLReader xmlReader)
Sets the XMLReader used for parsing-
Methods 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
-
-
-
-
Method Detail
-
doTag
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException
Description copied from interface:Tag
Evaluates this tag after all the tags properties have been initialized.
-
getVar
public String getVar()
The variable name that will be used for the Document variable created
-
setVar
public void setVar(String var)
Sets the variable name that will be used for the Document variable created
-
getText
public String getText()
Returns the text to be parsed- Returns:
- String
-
setText
public void setText(String text)
Sets the text to be parsed by this parser- Parameters:
text
- The text to be parsed by this parser
-
getXMLReader
public XMLReader getXMLReader() throws ParserConfigurationException, SAXException
- Returns:
- the XMLReader used for parsing, creating one lazily if need be
- Throws:
ParserConfigurationException
SAXException
-
setXMLReader
public void setXMLReader(XMLReader xmlReader)
Sets the XMLReader used for parsing
-
getJellyParser
public XMLParser getJellyParser()
- Returns:
- XMLParser
-
setJellyParser
public void setJellyParser(XMLParser jellyParser)
Sets the jellyParser.- Parameters:
jellyParser
- The jellyParser to set
-
createXMLReader
protected XMLReader createXMLReader() throws ParserConfigurationException, SAXException
Factory method to create a new XMLReader
-
parseBody
protected void parseBody(XMLOutput output) throws JellyTagException
Parses the body of this tag and returns the parsed document- Throws:
JellyTagException
-
parseText
protected void parseText(String text) throws JellyTagException
Parses the give piece of text as being markup- Throws:
JellyTagException
-
createJellyParser
protected XMLParser createJellyParser()
Factory method to create a new Jelly parser- Returns:
- XMLParser
-
-