public abstract class AbstractStylesheetFactory
extends javax.xml.transform.sax.SAXTransformerFactory
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractStylesheetFactory() |
| Modifier and Type | Method and Description |
|---|---|
javax.xml.transform.Source |
getAssociatedStylesheet(javax.xml.transform.Source source,
java.lang.String media,
java.lang.String title,
java.lang.String charset)
Returns the stylesheet source object associated with the given
XML document.
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns an implementation-specific attribute.
|
java.lang.ClassLoader |
getClassLoader()
Gets the classloader for the stylesheet.
|
java.lang.String |
getClassName() |
javax.xml.transform.ErrorListener |
getErrorListener()
Returns the error listener.
|
boolean |
getFeature(java.lang.String name)
Returns an implementation-specific feature.
|
boolean |
getLoadPrecompiledStylesheet()
Returns true if precompiled stylesheets should be loaded.
|
Path |
getSearchPath()
Returns the stylesheet search path.
|
Path |
getStylePath()
Returns the stylesheet search path.
|
java.lang.String |
getSystemId() |
javax.xml.transform.URIResolver |
getURIResolver()
Returns the URI to filename resolver.
|
Path |
getWorkPath()
Gets the working directory.
|
boolean |
isAutoCompile()
Returns true if the stylesheet should be automatically compiled.
|
protected StylesheetImpl |
loadStylesheet(java.lang.String systemId,
java.lang.String className)
Loads the compiled stylesheet .class file
|
StylesheetImpl |
newStylesheet(org.w3c.dom.Document xsl)
Creates a new stylesheet from an XML document.
|
StylesheetImpl |
newStylesheet(java.io.InputStream is)
Create a new stylesheet from an input stream.
|
StylesheetImpl |
newStylesheet(Path path) |
StylesheetImpl |
newStylesheet(java.io.Reader reader)
Create a new stylesheet from a reader.
|
StylesheetImpl |
newStylesheet(java.lang.String systemId)
Loads a stylesheet from a named file
|
javax.xml.transform.Templates |
newTemplates(org.w3c.dom.Node node)
Convenience class to create a compiled stylesheet.
|
javax.xml.transform.Templates |
newTemplates(javax.xml.transform.Source source)
Create a compiled stylesheet from an input stream.
|
javax.xml.transform.Templates |
newTemplates(java.lang.String systemId)
Convenience class to create a compiled stylesheet.
|
javax.xml.transform.sax.TemplatesHandler |
newTemplatesHandler()
Returns a templates handler.
|
javax.xml.transform.Transformer |
newTransformer()
Create an identity transformer.
|
javax.xml.transform.Transformer |
newTransformer(org.w3c.dom.Document xsl)
Convenience class to create a transformer instance.
|
javax.xml.transform.Transformer |
newTransformer(javax.xml.transform.Source source)
Create a transformer from an input stream.
|
javax.xml.transform.sax.TransformerHandler |
newTransformerHandler()
Create a new transformer handler.
|
javax.xml.transform.sax.TransformerHandler |
newTransformerHandler(javax.xml.transform.Source source)
Create a new transformer handler based on a source.
|
javax.xml.transform.sax.TransformerHandler |
newTransformerHandler(javax.xml.transform.Templates templates)
Create a new transformer handler based on a stylesheet.
|
org.xml.sax.XMLFilter |
newXMLFilter(javax.xml.transform.Source source)
Returns an XML filter from the transformer.
|
org.xml.sax.XMLFilter |
newXMLFilter(javax.xml.transform.Templates templates)
Returns an XML filter from the transformer.
|
protected org.w3c.dom.Node |
parseStylesheet(javax.xml.transform.Source source)
Parses a stylesheet from the source.
|
protected abstract org.w3c.dom.Document |
parseXSL(ReadStream rs)
Parses the XSL into a DOM document.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an implementation-specific attribute.
|
void |
setAutoCompile(boolean autoCompile)
Returns true if precompiled stylesheets should be loaded.
|
void |
setClassLoader(java.lang.ClassLoader loader)
Sets the classloader for the stylesheet.
|
void |
setClassName(java.lang.String className) |
void |
setErrorListener(javax.xml.transform.ErrorListener errorListener)
Sets the error listener.
|
void |
setFeature(java.lang.String name,
boolean value)
Sets an implementation-specific feature
|
void |
setLoadPrecompiledStylesheet(boolean preload)
Returns true if precompiled stylesheets should be loaded.
|
void |
setSearchPath(Path path)
Sets the search path for stylesheets.
|
void |
setStylePath(Path path)
Sets the search path for stylesheets.
|
void |
setSystemId(java.lang.String systemId) |
void |
setURIResolver(javax.xml.transform.URIResolver uriResolver)
Sets the URI to filename resolver.
|
void |
setWorkPath(Path path)
Sets the working directory.
|
void |
transform(org.w3c.dom.Document xsl,
org.w3c.dom.Node xml,
java.io.OutputStream out)
Convenience class to transform a node.
|
void |
transform(java.lang.String xsl,
org.w3c.dom.Node xml,
java.io.OutputStream out)
Convenience class to transform a node.
|
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in class javax.xml.transform.TransformerFactoryname - the attribute namepublic void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in class javax.xml.transform.TransformerFactoryname - the attribute namevalue - the attribute valuepublic boolean getFeature(java.lang.String name)
getFeature in class javax.xml.transform.TransformerFactoryname - the feature namepublic void setFeature(java.lang.String name,
boolean value)
setFeature in class javax.xml.transform.TransformerFactoryname - the feature namevalue - the feature valuepublic javax.xml.transform.URIResolver getURIResolver()
getURIResolver in class javax.xml.transform.TransformerFactorypublic void setURIResolver(javax.xml.transform.URIResolver uriResolver)
setURIResolver in class javax.xml.transform.TransformerFactorypublic javax.xml.transform.ErrorListener getErrorListener()
getErrorListener in class javax.xml.transform.TransformerFactorypublic void setErrorListener(javax.xml.transform.ErrorListener errorListener)
setErrorListener in class javax.xml.transform.TransformerFactorypublic java.lang.String getSystemId()
public void setSystemId(java.lang.String systemId)
public void setStylePath(Path path)
path - path containing stylesheets.public Path getStylePath()
public void setSearchPath(Path path)
path - path containing stylesheets.public Path getSearchPath()
public void setWorkPath(Path path)
public Path getWorkPath()
public void setClassName(java.lang.String className)
public java.lang.String getClassName()
public void setClassLoader(java.lang.ClassLoader loader)
loader - the new loader.public java.lang.ClassLoader getClassLoader()
public boolean getLoadPrecompiledStylesheet()
public void setLoadPrecompiledStylesheet(boolean preload)
public boolean isAutoCompile()
public void setAutoCompile(boolean autoCompile)
public javax.xml.transform.Source getAssociatedStylesheet(javax.xml.transform.Source source,
java.lang.String media,
java.lang.String title,
java.lang.String charset)
throws javax.xml.transform.TransformerConfigurationException
getAssociatedStylesheet in class javax.xml.transform.TransformerFactorysource - the XML document which needs a stylesheet.media - the media attribute for the stylesheettitle - the title attribute for the stylesheetcharset - the character encoding for the stylesheet result.javax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.Transformer newTransformer(javax.xml.transform.Source source)
throws javax.xml.transform.TransformerConfigurationException
newTransformer in class javax.xml.transform.TransformerFactorysource - the source streamjavax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.Transformer newTransformer()
throws javax.xml.transform.TransformerConfigurationException
newTransformer in class javax.xml.transform.TransformerFactoryjavax.xml.transform.TransformerConfigurationExceptionpublic StylesheetImpl newStylesheet(org.w3c.dom.Document xsl) throws java.lang.Exception
java.lang.Exceptionpublic StylesheetImpl newStylesheet(java.io.Reader reader) throws java.lang.Exception
java.lang.Exceptionpublic StylesheetImpl newStylesheet(java.io.InputStream is) throws java.lang.Exception
java.lang.Exceptionpublic StylesheetImpl newStylesheet(java.lang.String systemId) throws java.lang.Exception
systemId - the URL of the filejava.lang.Exceptionpublic StylesheetImpl newStylesheet(Path path) throws java.lang.Exception
java.lang.Exceptionpublic javax.xml.transform.Templates newTemplates(javax.xml.transform.Source source)
throws javax.xml.transform.TransformerConfigurationException
newTemplates in class javax.xml.transform.TransformerFactorysource - the source streamjavax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.sax.TransformerHandler newTransformerHandler()
throws javax.xml.transform.TransformerConfigurationException
newTransformerHandler in class javax.xml.transform.sax.SAXTransformerFactoryjavax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.sax.TransformerHandler newTransformerHandler(javax.xml.transform.Source source)
throws javax.xml.transform.TransformerConfigurationException
newTransformerHandler in class javax.xml.transform.sax.SAXTransformerFactoryjavax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.sax.TransformerHandler newTransformerHandler(javax.xml.transform.Templates templates)
throws javax.xml.transform.TransformerConfigurationException
newTransformerHandler in class javax.xml.transform.sax.SAXTransformerFactoryjavax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.sax.TemplatesHandler newTemplatesHandler()
throws javax.xml.transform.TransformerConfigurationException
newTemplatesHandler in class javax.xml.transform.sax.SAXTransformerFactorysource - the source filejavax.xml.transform.TransformerConfigurationExceptionpublic org.xml.sax.XMLFilter newXMLFilter(javax.xml.transform.Source source)
throws javax.xml.transform.TransformerConfigurationException
newXMLFilter in class javax.xml.transform.sax.SAXTransformerFactorysource - the source filejavax.xml.transform.TransformerConfigurationExceptionpublic org.xml.sax.XMLFilter newXMLFilter(javax.xml.transform.Templates templates)
throws javax.xml.transform.TransformerConfigurationException
newXMLFilter in class javax.xml.transform.sax.SAXTransformerFactorysource - the source filejavax.xml.transform.TransformerConfigurationExceptionprotected org.w3c.dom.Node parseStylesheet(javax.xml.transform.Source source)
throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.Templates newTemplates(org.w3c.dom.Node node)
throws javax.xml.transform.TransformerConfigurationException
node - DOM source for the stylesheet.javax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.Templates newTemplates(java.lang.String systemId)
throws javax.xml.transform.TransformerConfigurationException
systemId - source path for the stylesheet.javax.xml.transform.TransformerConfigurationExceptionpublic javax.xml.transform.Transformer newTransformer(org.w3c.dom.Document xsl)
throws javax.xml.transform.TransformerConfigurationException
xsl - DOM source for the stylesheet.javax.xml.transform.TransformerConfigurationExceptionpublic void transform(org.w3c.dom.Document xsl,
org.w3c.dom.Node xml,
java.io.OutputStream out)
throws java.lang.Exception
xsl - DOM containing the parsed xsl.xml - DOM document node.out - output stream destination.java.lang.Exceptionpublic void transform(java.lang.String xsl,
org.w3c.dom.Node xml,
java.io.OutputStream out)
throws java.lang.Exception
xsl - path name to the xsl file.xml - dom source document.out - output stream destination.java.lang.Exceptionprotected abstract org.w3c.dom.Document parseXSL(ReadStream rs) throws javax.xml.transform.TransformerConfigurationException
rs - the input stream.javax.xml.transform.TransformerConfigurationExceptionprotected StylesheetImpl loadStylesheet(java.lang.String systemId, java.lang.String className) throws java.lang.Exception
className - the mangled classname for the stylesheetjava.lang.Exception