Devsphere.com


com.devsphere.xml.taglib.output.tag
Class Document

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--javax.servlet.jsp.tagext.BodyTagSupport
              |
              +--com.devsphere.xml.taglib.support.tag.CommonSupport
                    |
                    +--com.devsphere.xml.taglib.output.tag.OutputSupport
                          |
                          +--com.devsphere.xml.taglib.output.tag.Fragment
                                |
                                +--com.devsphere.xml.taglib.output.tag.Document
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 Document
extends Fragment

Handler for the <o:document> tag that outputs a DOM tree or just sets the context for generating an XML document dynamically.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.devsphere.xml.taglib.output.tag.Fragment
dom, domExpr
 
Fields inherited from class com.devsphere.xml.taglib.output.tag.OutputSupport
ancestor, previousOut, serializer
 
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
Document()
           
 
Method Summary
protected  void endOutput()
          Ends the output of the document.
protected  java.util.List getAllowedAncestors()
          Returns the list of names of the tags that may contain the tag that is handled by this class.
protected  java.util.Properties getOutputProperties()
          Returns the output properties.
 java.lang.String getTagName()
          Returns the name of the handled tag
protected  void init()
          Initializes the fields of this tag handler.
protected  void initOutput()
          Initializes this tag handler for output, creating the serializer object.
 void setEncoding(java.lang.String encodingExpr)
          Sets the XML encoding.
 void setPublicId(java.lang.String publicIdExpr)
          Sets the public doctype identifier of the produced XML document.
 void setStandalone(java.lang.String standaloneExpr)
          Sets a flag indicating if the document should be declared standalone.
 void setSystemId(java.lang.String systemIdExpr)
          Sets the system doctype identifier of the produced XML document.
 void setVersion(java.lang.String versionExpr)
          Sets the XML version.
 void setXmldecl(java.lang.String xmldeclExpr)
          Sets a flag indicating if the XML declaration should be included at the beginning of the produced XML document.
protected  void startOutput()
          Serializes the DOM tree, if the dom attribute is present.
 
Methods inherited from class com.devsphere.xml.taglib.output.tag.Fragment
setDom, setIndent, setMethod, shouldIgnoreContent
 
Methods inherited from class com.devsphere.xml.taglib.output.tag.OutputSupport
doEndTag, doStartTag, emptyComment, shouldBufferContent
 
Methods inherited from class com.devsphere.xml.taglib.support.tag.CommonSupport
checkVarName, checkVarScope, doCatch, doFinally, eval, evalBoolean, evalDouble, evalInt, evalString, export, export, getDebug, getLogger, log, log, log, restore, validate
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, 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

Document

public Document()
Method Detail

init

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

Overrides:
init in class Fragment

getTagName

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

Overrides:
getTagName in class Fragment
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.

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

setXmldecl

public void setXmldecl(java.lang.String xmldeclExpr)
                throws javax.servlet.jsp.JspException
Sets a flag indicating if the XML declaration should be included at the beginning of the produced XML document.

Throws:
javax.servlet.jsp.JspException - to signal any error that might occur

setStandalone

public void setStandalone(java.lang.String standaloneExpr)
                   throws javax.servlet.jsp.JspException
Sets a flag indicating if the document should be declared standalone.

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

setVersion

public void setVersion(java.lang.String versionExpr)
                throws javax.servlet.jsp.JspException
Sets the XML version.

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

setEncoding

public void setEncoding(java.lang.String encodingExpr)
                 throws javax.servlet.jsp.JspException
Sets the XML encoding.

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

setPublicId

public void setPublicId(java.lang.String publicIdExpr)
                 throws javax.servlet.jsp.JspException
Sets the public doctype identifier of the produced XML document.

Parameters:
publicIdExpr - the expression that will be evaluated
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 doctype identifier of the produced XML document.

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

getOutputProperties

protected java.util.Properties getOutputProperties()
                                            throws javax.servlet.jsp.JspException
Returns the output properties.

Overrides:
getOutputProperties in class Fragment
Returns:
the output properties
Throws:
javax.servlet.jsp.JspException - to signal any error that might occur

initOutput

protected void initOutput()
                   throws javax.servlet.jsp.JspException
Initializes this tag handler for output, creating the serializer object.

Overrides:
initOutput in class OutputSupport
Throws:
javax.servlet.jsp.JspException - to signal a tag validation error

startOutput

protected void startOutput()
                    throws javax.servlet.jsp.JspException,
                           org.xml.sax.SAXException
Serializes the DOM tree, if the dom attribute is present. Otherwise, it starts a document whose content can be produced by tags of this library.

Overrides:
startOutput in class Fragment
Throws:
javax.servlet.jsp.JspException - to signal an error
org.xml.sax.SAXException - to signal an error

endOutput

protected void endOutput()
                  throws javax.servlet.jsp.JspException,
                         org.xml.sax.SAXException
Ends the output of the document.

Overrides:
endOutput in class Fragment
Throws:
javax.servlet.jsp.JspException - to signal an error
org.xml.sax.SAXException - to signal an error

 Devsphere.com