Devsphere.com


com.devsphere.xml.taglib.process.tag
Class Parse

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--javax.servlet.jsp.tagext.BodyTagSupport
              |
              +--com.devsphere.xml.taglib.support.tag.CommonSupport
                    |
                    +--com.devsphere.xml.taglib.process.tag.ProcessSupport
                          |
                          +--com.devsphere.xml.taglib.process.tag.Parse
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally

public class Parse
extends ProcessSupport

Handler for the <p:parse> tag, which can be used to parse an XML document. Its body may contain a <p:start> tag for processing the startDocument() SAX event, followed by an <p:element> tag for processing the document's root element, followed by an optional <p:end> tag for processing the endDocument() SAX event.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.devsphere.xml.taglib.process.tag.ProcessSupport
ancestor, event, handler, indentLevel
 
Fields inherited from class com.devsphere.xml.taglib.support.tag.CommonSupport
cachedDebug, cachedLogger, DEBUG_ATTR, DEFAULT_DEBUG, DEFAULT_RESTORE_VALUE, DEFAULT_SCOPE, LOGGER_ATTR, originalValues
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
Parse()
           
 
Method Summary
protected  boolean continueLoop()
          Returns true if the current event could be processed by a sub-tag.
protected  void finalizeLoop()
          Ends the parsing.
protected  java.util.List getAllowedAncestors()
          Returns the list of names of the tags that may contain the tag that is handled by this class.
 java.lang.String getTagName()
          Returns the name of the handled tag
protected  void init()
          Initializes the fields of this tag handler.
protected  void initLoop()
          Initializes the loop to process parsing events.
 void setIgnoreSpaces(java.lang.String ignoreSpacesExpr)
          Sets the flag indicating if space character data should be ignored.
 void setSystemId(java.lang.String systemIdExpr)
          Sets the system identifier of the XML input source that must be parsed.
 void setValidate(java.lang.String validateExpr)
          Sets the flag indicating if the parser should validate the XML input source.
 void setXml(java.lang.String xmlExpr)
          Sets the XML input source that must be parsed.
protected  boolean startLoop()
          Returns true if the current event is a StartDocument instance.
 
Methods inherited from class com.devsphere.xml.taglib.process.tag.ProcessSupport
doAfterBody, doEndTag, doFinally, doStartTag, getEvent, logEvent, logEvent, removeEvent, validate
 
Methods inherited from class com.devsphere.xml.taglib.support.tag.CommonSupport
checkVarName, checkVarScope, doCatch, eval, evalBoolean, evalDouble, evalInt, evalString, export, export, getDebug, getLogger, log, log, log, restore
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

Parse

public Parse()
Method Detail

init

protected void init()
Initializes the fields of this tag handler.

Overrides:
init in class ProcessSupport

getTagName

public java.lang.String getTagName()
Returns the name of the handled tag

Specified by:
getTagName in class CommonSupport
Returns:
the name of the handled tag

getAllowedAncestors

protected java.util.List getAllowedAncestors()
Returns the list of names of the tags that may contain the tag that is handled by this class.

Specified by:
getAllowedAncestors in class CommonSupport
Returns:
the list of names of the allowed ancestor tags or null if the tag context doesn't matter.

setXml

public void setXml(java.lang.String xmlExpr)
            throws javax.servlet.jsp.JspException
Sets the XML input source that must be parsed. The parameter must be an expression that can be evaluated to one of the following types:

Parameters:
xmlExpr - the expression that must evaluate to an XML input source, input stream, reader or string
Throws:
javax.servlet.jsp.JspException - to signal any error that might occur

setSystemId

public void setSystemId(java.lang.String systemIdExpr)
                 throws javax.servlet.jsp.JspException
Sets the system identifier of the XML input source that must be parsed.

Parameters:
systemIdExpr - the expression that will be evaluated
Throws:
javax.servlet.jsp.JspException - to signal any error that might occur

setValidate

public void setValidate(java.lang.String validateExpr)
                 throws javax.servlet.jsp.JspException
Sets the flag indicating if the parser should validate the XML input source.

Parameters:
validateExpr - the expression that will be evaluated
Throws:
javax.servlet.jsp.JspException - to signal any error that might occur

setIgnoreSpaces

public void setIgnoreSpaces(java.lang.String ignoreSpacesExpr)
                     throws javax.servlet.jsp.JspException
Sets the flag indicating if space character data should be ignored.

Parameters:
ignoreSpacesExpr - the expression that will be evaluated
Throws:
javax.servlet.jsp.JspException - to signal any error that might occur

initLoop

protected void initLoop()
                 throws javax.servlet.jsp.JspException
Initializes the loop to process parsing events.

Overrides:
initLoop in class ProcessSupport
Throws:
javax.servlet.jsp.JspException - to signal any tag validation error

startLoop

protected boolean startLoop()
                     throws javax.servlet.jsp.JspException
Returns true if the current event is a StartDocument instance.

Specified by:
startLoop in class ProcessSupport
Returns:
true if the event loop should be started
Throws:
javax.servlet.jsp.JspException - to signal an error

continueLoop

protected boolean continueLoop()
                        throws javax.servlet.jsp.JspException
Returns true if the current event could be processed by a sub-tag.

Specified by:
continueLoop in class ProcessSupport
Returns:
true if the event loop should be continued
Throws:
javax.servlet.jsp.JspException - to signal an error

finalizeLoop

protected void finalizeLoop()
Ends the parsing.

Overrides:
finalizeLoop in class ProcessSupport

 Devsphere.com