public class TransformingSAXEventProvider extends Transformer implements SAXEventProvider
The GNU Lesser General Public License for details.
Modifier and Type | Class and Description |
---|---|
private static class |
TransformingSAXEventProvider.TemplateInfo
A simple class to link modification times to Templates objects
|
Modifier and Type | Field and Description |
---|---|
private static boolean |
developmentMode
In development mode the style sheet is checked for modifications before use and if so, it is recompiled.
|
private ErrorListener |
errors
The remembered ErrorListener because the transformer has not been created
|
private static org.slf4j.Logger |
log
The log stream
|
private Properties |
outputs
The remembered OutputProperties because the transformer has not been
created
|
private Map<String,Object> |
params
The remembered Parameters because the transformer has not been created
|
private URIResolver |
resolver
The remembered URIResolver because the transformer has not been created
|
private TransformerFactory |
transfact
How we get the transformer objects
|
private static Map<URI,TransformingSAXEventProvider.TemplateInfo> |
txers
A cache of transformers
|
private SAXEventProvider |
xmlsep
The XML input source
|
private URI |
xsluri
The XSL stylesheet
|
Constructor and Description |
---|
TransformingSAXEventProvider(URI xsluri,
SAXEventProvider xmlsep)
Simple ctor
|
Modifier and Type | Method and Description |
---|---|
void |
clearParameters() |
ErrorListener |
getErrorListener() |
Properties |
getOutputProperties() |
String |
getOutputProperty(String name) |
Object |
getParameter(String name) |
private TransformingSAXEventProvider.TemplateInfo |
getTemplateInfo()
Compile the XSL or retrieve it from the cache
|
URIResolver |
getURIResolver() |
static boolean |
isDevelopmentMode()
In development mode the style sheet is checked for modifications before use and if so, it is recompiled.
|
void |
provideSAXEvents(ContentHandler handler)
When SAX events are required the user of this interface can call this
method.
|
static void |
setDevelopmentMode(boolean developmentMode)
In development mode the style sheet is checked for modifications before use and if so, it is recompiled.
|
void |
setErrorListener(ErrorListener errors) |
void |
setOutputProperties(Properties outputs) |
void |
setOutputProperty(String name,
String value) |
void |
setParameter(String name,
Object value) |
void |
setURIResolver(URIResolver resolver) |
void |
transform(Source xmlSource,
Result outputTarget) |
reset
private static boolean developmentMode
private ErrorListener errors
private URIResolver resolver
private Properties outputs
private Map<String,Object> params
private URI xsluri
private SAXEventProvider xmlsep
private TransformerFactory transfact
private static Map<URI,TransformingSAXEventProvider.TemplateInfo> txers
private static final org.slf4j.Logger log
public TransformingSAXEventProvider(URI xsluri, SAXEventProvider xmlsep)
xsluri
- the URI of XSLxmlsep
- a SAX Event Provider for an XML documentprivate TransformingSAXEventProvider.TemplateInfo getTemplateInfo() throws TransformerConfigurationException, IOException
TransformerConfigurationException
- when there is a problem with configuring the transformerIOException
- when there is an I/O errorpublic void transform(Source xmlSource, Result outputTarget) throws TransformerException
transform
in class Transformer
TransformerException
public void provideSAXEvents(ContentHandler handler) throws SAXException
SAXEventProvider
provideSAXEvents
in interface SAXEventProvider
handler
- The place to send SAX events.SAXException
- when a SAX encounters a problempublic ErrorListener getErrorListener()
getErrorListener
in class Transformer
public void setErrorListener(ErrorListener errors) throws IllegalArgumentException
setErrorListener
in class Transformer
IllegalArgumentException
public URIResolver getURIResolver()
getURIResolver
in class Transformer
public void setURIResolver(URIResolver resolver)
setURIResolver
in class Transformer
public Properties getOutputProperties()
getOutputProperties
in class Transformer
public void setOutputProperties(Properties outputs) throws IllegalArgumentException
setOutputProperties
in class Transformer
IllegalArgumentException
public String getOutputProperty(String name) throws IllegalArgumentException
getOutputProperty
in class Transformer
IllegalArgumentException
public void setOutputProperty(String name, String value) throws IllegalArgumentException
setOutputProperty
in class Transformer
IllegalArgumentException
public void clearParameters()
clearParameters
in class Transformer
public Object getParameter(String name)
getParameter
in class Transformer
public void setParameter(String name, Object value)
setParameter
in class Transformer
public static void setDevelopmentMode(boolean developmentMode)
developmentMode
- the developmentMode to setpublic static boolean isDevelopmentMode()