org.apache.commons.jelly.tags.xml

## Class ParseTagSupport

- java.lang.Object
- - org.apache.commons.jelly.TagSupport
  - - org.apache.commons.jelly.tags.xml.ParseTagSupport

All Implemented Interfaces:
  Tag

Direct Known Subclasses:
  ParseTag

    public abstract class ParseTagSupport
    extends TagSupport

An abstract base class for any tag which parsers its body as XML.

Version:
  $Revision: 155420 $
Author:
  James Strachan

### Field Summary

### Fields inherited from class org.apache.commons.jelly.TagSupport

`body, context, parent`

### Constructor Summary

Constructors
Constructor and Description
`ParseTagSupport()`

### Method Summary

Methods
`protected abstract org.dom4j.io.SAXReader` `createSAXReader()` Factory method to create a new SAXReader
`org.dom4j.io.SAXReader` `getSAXReader()`
`String` `getText()` Returns the text to be parsed
`String` `getVar()` The variable name that will be used for the Document variable created
`protected org.dom4j.Document` `parse(Object source)` Parses the given source
`protected org.dom4j.Document` `parseBody(XMLOutput output)` Parses the body of this tag and returns the parsed document
`protected org.dom4j.Document` `parseText(String text)` Parses the give piece of text as being markup
`void` `setSAXReader(org.dom4j.io.SAXReader saxReader)` Sets the SAXReader used for parsing
`void` `setText(String text)` Sets the text to be parsed by this parser
`void` `setVar(String var)` Sets the variable name that will be used for the Document variable created

### 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.commons.jelly.Tag

`doTag`

### Constructor Detail

#### ParseTagSupport

    public ParseTagSupport()

### Method Detail

#### 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

#### getSAXReader

    public org.dom4j.io.SAXReader getSAXReader()
                                        throws SAXException

Returns:
  the SAXReader used for parsing, creating one lazily if need be
Throws:
  `SAXException`

#### setSAXReader

    public void setSAXReader(org.dom4j.io.SAXReader saxReader)

Sets the SAXReader used for parsing

#### createSAXReader

    protected abstract org.dom4j.io.SAXReader createSAXReader()
                                                       throws SAXException

Factory method to create a new SAXReader

Throws:
  `SAXException`

#### parseBody

    protected org.dom4j.Document parseBody(XMLOutput output)
                                    throws JellyTagException

Parses the body of this tag and returns the parsed document

Throws:
  `JellyTagException`

#### parseText

    protected org.dom4j.Document parseText(String text)
                                    throws JellyTagException

Parses the give piece of text as being markup

Throws:
  `JellyTagException`

#### parse

    protected org.dom4j.Document parse(Object source)
                                throws JellyTagException

Parses the given source

Throws:
  `JellyTagException`