public abstract class TransformSupport
extends javax.servlet.jsp.tagext.BodyTagSupport
Support for tag handlers for <transform>, the XML transformation tag.
| Modifier and Type | Class and Description |
|---|---|
private static class |
TransformSupport.JstlUriResolver
Lets us resolve relative external entities.
|
private static class |
TransformSupport.SafeWriter
A Writer based on a wrapped Writer but ignoring requests to
close() and flush() it.
|
| Modifier and Type | Field and Description |
|---|---|
private javax.xml.parsers.DocumentBuilder |
db |
protected javax.xml.transform.Result |
result |
private int |
scope |
private javax.xml.transform.Transformer |
t |
private javax.xml.transform.TransformerFactory |
tf |
private java.lang.String |
var |
protected java.lang.Object |
xml |
protected boolean |
xmlSpecified |
protected java.lang.String |
xmlSystemId |
protected java.lang.Object |
xslt |
protected java.lang.String |
xsltSystemId |
| Constructor and Description |
|---|
TransformSupport() |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(java.lang.String name,
java.lang.Object value)
Sets (adds) a transformation parameter on our transformer.
|
int |
doEndTag() |
int |
doStartTag() |
(package private) javax.xml.transform.Source |
getDocumentFromBodyContent()
Return the Source for a document specified as body content.
|
(package private) javax.xml.transform.Source |
getSource(java.io.Reader reader,
java.lang.String systemId)
Create a Source from a Reader
|
(package private) javax.xml.transform.Source |
getSourceFromXmlAttribute()
Return the Source for a document specified in the "doc" or "xml" attribute.
|
(package private) javax.xml.transform.Transformer |
getTransformer(java.lang.Object xslt,
java.lang.String systemId)
Create a Transformer from the xslt attribute.
|
private void |
init() |
void |
release() |
void |
setPageContext(javax.servlet.jsp.PageContext pageContext) |
void |
setScope(java.lang.String scope) |
void |
setVar(java.lang.String var) |
private static java.lang.String |
wrapSystemId(java.lang.String systemId)
Wraps systemId with a "jstl:" prefix to prevent the parser from
thinking that the URI is truly relative and resolving it against
the current directory in the filesystem.
|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContentfindAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValueprotected java.lang.Object xml
protected boolean xmlSpecified
protected java.lang.String xmlSystemId
protected java.lang.Object xslt
protected java.lang.String xsltSystemId
protected javax.xml.transform.Result result
private java.lang.String var
private int scope
private javax.xml.transform.Transformer t
private javax.xml.transform.TransformerFactory tf
private javax.xml.parsers.DocumentBuilder db
private void init()
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspExceptionpublic int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspExceptionpublic void release()
release in interface javax.servlet.jsp.tagext.Tagrelease in class javax.servlet.jsp.tagext.BodyTagSupportpublic void setPageContext(javax.servlet.jsp.PageContext pageContext)
setPageContext in interface javax.servlet.jsp.tagext.TagsetPageContext in class javax.servlet.jsp.tagext.TagSupportpublic void addParameter(java.lang.String name,
java.lang.Object value)
private static java.lang.String wrapSystemId(java.lang.String systemId)
javax.xml.transform.Transformer getTransformer(java.lang.Object xslt,
java.lang.String systemId)
throws javax.servlet.jsp.JspException
xslt - the xslt attributesystemId - the systemId for the transformjavax.servlet.jsp.JspException - if there was a problem creating the transformerjavax.xml.transform.Source getSourceFromXmlAttribute()
throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException - if there is a problem with the attributejavax.xml.transform.Source getDocumentFromBodyContent()
throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException - if there is a problem with the body contentjavax.xml.transform.Source getSource(java.io.Reader reader,
java.lang.String systemId)
throws javax.servlet.jsp.JspTagException
reader - the Reader to readsystemId - the systemId for the documentjavax.servlet.jsp.JspTagException - if there is a problem creating the Sourcepublic void setVar(java.lang.String var)
public void setScope(java.lang.String scope)