Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.xml
Class TransformingSAXEventProvider

    java.lang.Object
      javax.xml.transform.Transformer
          org.crosswire.common.xml.TransformingSAXEventProvider

All Implemented Interfaces:
  SAXEventProvider

    public class TransformingSAXEventProvider

extends Transformer
implements SAXEventProvider

A SAXEventProvider that gets its output data from an XSL stylesheet and another SAXEventProvider (supplying input XML).

Author:
  Joe Walker [joe at eireneh dot com]
See Also:
  `for license details.
  The copyright to this program is held by it's authors.`

Nested Class Summary
`private static class` | `TransformingSAXEventProvider.TemplateInfo` A simple struct to link modification times to Templates objects

Field Summary
`private ErrorListener` | `errors` The remembered ErrorListener because the transformer has not been created
`private static Logger` | `log` The log stream
`private Properties` | `outputs` The remembered OutputProperties because the transformer has not been created
`private Map` | `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` | `txers` A cache of transformers
`private SAXEventProvider` | `xmlsep` The XML input source
`private URL` | `xslurl` The XSL stylesheet

Constructor Summary
`TransformingSAXEventProvider(URL xslurl, SAXEventProvider xmlsep)` Simple ctor

Method Summary
`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()`
`void` | `provideSAXEvents(ContentHandler handler)` When SAX events are required the user of this interface can call this method.
`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)`

Methods inherited from class javax.xml.transform.Transformer
`reset`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### errors

    private ErrorListener errors

  The remembered ErrorListener because the transformer has not been created

### resolver

    private URIResolver resolver

  The remembered URIResolver because the transformer has not been created

### outputs

    private Properties outputs

  The remembered OutputProperties because the transformer has not been created

### params

    private Map params

  The remembered Parameters because the transformer has not been created

### xslurl

    private URL xslurl

  The XSL stylesheet

### xmlsep

    private SAXEventProvider xmlsep

  The XML input source

### transfact

    private TransformerFactory transfact

  How we get the transformer objects

### txers

    private static Map txers

  A cache of transformers

### log

    private static final Logger log

  The log stream

Constructor Detail

### TransformingSAXEventProvider

    public TransformingSAXEventProvider(URL xslurl,
                                        SAXEventProvider xmlsep)

  Simple ctor

Method Detail

### getTemplateInfo

    private TransformingSAXEventProvider.TemplateInfo getTemplateInfo()
                                                               throws IOException,
                                                                      TransformerConfigurationException

  Compile the XSL or retrieve it from the cache

  Throws:
    `IOException`
    `TransformerConfigurationException`

### transform

    public void transform(Source xmlSource,
                          Result outputTarget)
                   throws TransformerException

  Specified by:
    `transform` in class `Transformer`
  Throws:
    `TransformerException`

### provideSAXEvents

    public void provideSAXEvents(ContentHandler handler)
                          throws SAXException

  Description copied from interface: `SAXEventProvider`
  When SAX events are required the user of this interface can call this method.

  Specified by:
    `provideSAXEvents` in interface `SAXEventProvider`
  Parameters:
    `handler` - The place to send SAX events.
  Throws:
    `SAXException`

### getErrorListener

    public ErrorListener getErrorListener()

  Specified by:
    `getErrorListener` in class `Transformer`
  See Also:
    `Transformer.getErrorListener()`

### setErrorListener

    public void setErrorListener(ErrorListener errors)
                          throws IllegalArgumentException

  Specified by:
    `setErrorListener` in class `Transformer`
  Throws:
    `IllegalArgumentException`
  See Also:
    `Transformer.setErrorListener(javax.xml.transform.ErrorListener)`

### getURIResolver

    public URIResolver getURIResolver()

  Specified by:
    `getURIResolver` in class `Transformer`
  See Also:
    `Transformer.getURIResolver()`

### setURIResolver

    public void setURIResolver(URIResolver resolver)

  Specified by:
    `setURIResolver` in class `Transformer`
  See Also:
    `Transformer.setURIResolver(javax.xml.transform.URIResolver)`

### getOutputProperties

    public Properties getOutputProperties()

  Specified by:
    `getOutputProperties` in class `Transformer`
  See Also:
    `Transformer.getOutputProperties()`

### setOutputProperties

    public void setOutputProperties(Properties outputs)
                             throws IllegalArgumentException

  Specified by:
    `setOutputProperties` in class `Transformer`
  Throws:
    `IllegalArgumentException`
  See Also:
    `Transformer.setOutputProperties(java.util.Properties)`

### getOutputProperty

    public String getOutputProperty(String name)
                             throws IllegalArgumentException

  Specified by:
    `getOutputProperty` in class `Transformer`
  Throws:
    `IllegalArgumentException`
  See Also:
    `Transformer.getOutputProperty(java.lang.String)`

### setOutputProperty

    public void setOutputProperty(String name,
                                  String value)
                           throws IllegalArgumentException

  Specified by:
    `setOutputProperty` in class `Transformer`
  Throws:
    `IllegalArgumentException`
  See Also:
    `Transformer.setOutputProperty(java.lang.String, java.lang.String)`

### clearParameters

    public void clearParameters()

  Specified by:
    `clearParameters` in class `Transformer`
  See Also:
    `Transformer.clearParameters()`

### getParameter

    public Object getParameter(String name)

  Specified by:
    `getParameter` in class `Transformer`
  See Also:
    `Transformer.getParameter(java.lang.String)`

### setParameter

    public void setParameter(String name,
                             Object value)

  Specified by:
    `setParameter` in class `Transformer`
  See Also:
    `Transformer.setParameter(java.lang.String, java.lang.Object)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD