|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.templating.XSLTemplate
A class for loading, caching and generally managing XSL templates and transformers.
Field Summary | |
static String |
versionId
|
Constructor Summary | |
XSLTemplate(URL source)
Creates and loads a new template from source using
the default ErrorListener . |
|
XSLTemplate(URL source,
javax.xml.transform.ErrorListener listener)
Creates and loads a new template from source ,
using listener to handle any errors. |
Method Summary | |
List |
getDependents()
Gets a list of all dependent stylesheet files. |
URL |
getSource()
Gets the URL of the template source. |
boolean |
isModified()
Checks whether the XSL files associated with the template have been modified. |
javax.xml.transform.Transformer |
newTransformer()
Generates a new Transformer from the internal
Templates object. |
void |
toZIP(OutputStream os,
String base)
Creates a ZIP file containing this stylesheet and all dependant's. |
void |
transform(org.w3c.dom.Document doc,
PrintWriter writer)
Transforms doc and streams the result to
writer . |
void |
transform(org.w3c.dom.Document doc,
PrintWriter writer,
javax.xml.transform.ErrorListener listener)
Transforms doc and streams the result to
writer . |
void |
transform(javax.xml.transform.Source source,
javax.xml.transform.Result result)
Transforms the source document and sends it to
result . |
void |
transform(javax.xml.transform.Source source,
javax.xml.transform.Result result,
javax.xml.transform.ErrorListener listener)
Transforms the source document and sends it to
result . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public XSLTemplate(URL source, javax.xml.transform.ErrorListener listener)
source
,
using listener
to handle any errors.
source
- A URL
pointing to the template
source textlistener
- A ErrorListener
to customize
behavior on errorpublic XSLTemplate(URL source)
source
using
the default ErrorListener
.
source
- A URL
pointing to the template
source textMethod Detail |
public final URL getSource()
URL
of the template source.
URL
location of the template source;
it cannot be nullpublic final List getDependents()
List
of URL
s to dependent
stylesheet files; it cannot be nullpublic final javax.xml.transform.Transformer newTransformer()
Transformer
from the internal
Templates
object.
Transformer
; it cannot be nullpublic final void transform(javax.xml.transform.Source source, javax.xml.transform.Result result, javax.xml.transform.ErrorListener listener)
source
document and sends it to
result
. If there are errors,
listener
handles them. This method internally
creates and uses a new Transformer
.
source
- The Source
to be transformed; it
cannot be nullresult
- The Result
to capture the
transformed product; it cannot be nulllistener
- A ErrorListener
to handle
transformation errors; it cannot be nullpublic final void transform(javax.xml.transform.Source source, javax.xml.transform.Result result)
source
document and sends it to
result
. This method internally creates and uses a
new Transformer
.
source
- The Source
to be transformed; it
cannot be nullresult
- The Result
to capture the
transformed product; it cannot be nullpublic final void transform(org.w3c.dom.Document doc, PrintWriter writer, javax.xml.transform.ErrorListener listener)
doc
and streams the result to
writer
. If there are errors,
listener
handles them.
doc
- The Document
to transform; it cannot be
nullwriter
- The PrintWriter
to receive the
transformed result; it cannot be nulllistener
- A ErrorListener
to handle any
errors; it cannot be nullpublic final void transform(org.w3c.dom.Document doc, PrintWriter writer)
doc
and streams the result to
writer
.
doc
- The Document
to transform; it cannot be
nullwriter
- The PrintWriter
to receive the
transformed result; it cannot be nullpublic final boolean isModified()
true
if any dependent files have been
modified, otherwise false
public void toZIP(OutputStream os, String base) throws IOException
os
- the output stream to write the ZIP tobase
- the base directory in which the files will extract
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |