net.sf.joost.trax
Class TemplatesImpl

java.lang.Object
  extended by net.sf.joost.trax.TemplatesImpl
All Implemented Interfaces:
Templates, Constants, TrAXConstants

public class TemplatesImpl
extends Object
implements Templates, TrAXConstants

This class implements the Templates-Interface for TraX. Templates are thread-safe, so create one templates and call newTransformer() to get a new Transformer-Object.

Author:
Zubow

Field Summary
protected  TransformerFactoryImpl factory
          Holding a reference on a TransformerFactoryImpl should be visible for TrAXFilter
private static org.apache.commons.logging.Log log
           
private  Processor processor
          Holding a reference on the Joost-STX-Processor Processor
private  Object reentryGuard
          Synch object to guard against setting values from the TrAX interface or reentry while the transform is going on.
 
Fields inherited from interface net.sf.joost.trax.TrAXConstants
ALLOW_EXTERNAL_FUNCTIONS, DEBUG_FEATURE, IDENTITY_TRANSFORM, KEY_OUTPUT_URI_RESOLVER, KEY_TH_RESOLVER, KEY_XSLT_FACTORY, MESSAGE_EMITTER_CLASS, OUTPUT_KEY_SUPPORT_DISABLE_OUTPUT_ESCAPING
 
Fields inherited from interface net.sf.joost.Constants
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS
 
Constructor Summary
protected TemplatesImpl(Parser stxParser, TransformerFactoryImpl factory)
          Constructor used by TemplatesHandlerImpl
protected TemplatesImpl(XMLReader reader, InputSource isource, TransformerFactoryImpl factory)
          Constructor.
 
Method Summary
 Properties getOutputProperties()
          Gets the static properties for stx:output.
private  void init(Parser stxParser)
          Configures the Templates - initializing with a completed Parser object.
private  void init(XMLReader reader, InputSource isource)
          Configures the Templates - initializing by parsing the stylesheet.
 Transformer newTransformer()
          Method returns a Transformer-instance for transformation-process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

factory

protected TransformerFactoryImpl factory
Holding a reference on a TransformerFactoryImpl should be visible for TrAXFilter


processor

private Processor processor
Holding a reference on the Joost-STX-Processor Processor


reentryGuard

private Object reentryGuard
Synch object to guard against setting values from the TrAX interface or reentry while the transform is going on.

Constructor Detail

TemplatesImpl

protected TemplatesImpl(Parser stxParser,
                        TransformerFactoryImpl factory)
                 throws TransformerConfigurationException
Constructor used by TemplatesHandlerImpl

Parameters:
stxParser - A parsed stylesheet in form of Parser
Throws:
TransformerConfigurationException

TemplatesImpl

protected TemplatesImpl(XMLReader reader,
                        InputSource isource,
                        TransformerFactoryImpl factory)
                 throws TransformerConfigurationException
Constructor.

Parameters:
reader - The XMLReader for parsing the stylesheet
isource - The InputSource of the stylesheet
factory - A reference on a TransformerFactoryImpl
Throws:
TransformerConfigurationException - When an error occurs.
Method Detail

init

private void init(Parser stxParser)
           throws TransformerConfigurationException
Configures the Templates - initializing with a completed Parser object.

Parameters:
stxParser - A Parser
Throws:
TransformerConfigurationException - When an error occurs while initializing the Templates.

init

private void init(XMLReader reader,
                  InputSource isource)
           throws TransformerConfigurationException
Configures the Templates - initializing by parsing the stylesheet.

Parameters:
reader - The XMLReader for parsing the stylesheet
isource - The InputSource of the stylesheet
Throws:
TransformerConfigurationException - When an error occurs while initializing the Templates.

newTransformer

public Transformer newTransformer()
                           throws TransformerConfigurationException
Method returns a Transformer-instance for transformation-process

Specified by:
newTransformer in interface Templates
Returns:
A Transformer object.
Throws:
TransformerConfigurationException

getOutputProperties

public Properties getOutputProperties()
Gets the static properties for stx:output.

Specified by:
getOutputProperties in interface Templates
Returns:
Properties according to JAXP-Spec or null if an error is occured.