Package org.apache.sling.rewriter.impl.components

## Class TraxSerializer

- java.lang.Object
- - org.apache.sling.rewriter.impl.components.TraxSerializer

All Implemented Interfaces:
  `Serializer`, `ContentHandler`, `LexicalHandler`

    public class TraxSerializer
    extends Object
    implements Serializer, LexicalHandler

The `TraxSerializer` is a serializer based on the jaxp serializers.

### Constructor Summary

Constructors
`TraxSerializer​(TransformerHandler transformerHandler, ContentHandler handler, String outputFormat, String doctypePublic, String doctypeSystem)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `characters​(char[] c, int start, int len)`
`void` `comment​(char[] ch, int start, int len)`
`void` `dispose()` Dispose the serializer.
`void` `endCDATA()`
`void` `endDocument()`
`void` `endDTD()`
`void` `endElement​(String uri, String loc, String raw)`
`void` `endEntity​(String name)`
`void` `endPrefixMapping​(String prefix)`
`void` `ignorableWhitespace​(char[] c, int start, int len)`
`void` `init​(ProcessingContext context, ProcessingComponentConfiguration config)` Initialize this component.
`void` `processingInstruction​(String target, String data)`
`void` `setDocumentLocator​(Locator locator)`
`void` `skippedEntity​(String name)`
`void` `startCDATA()`
`void` `startDocument()`
`void` `startDTD​(String name, String publicId, String systemId)`
`void` `startElement​(String uri, String loc, String raw, Attributes a)`
`void` `startEntity​(String name)`
`void` `startPrefixMapping​(String prefix, String uri)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TraxSerializer

    public TraxSerializer​(TransformerHandler transformerHandler,
                          ContentHandler handler,
                          String outputFormat,
                          String doctypePublic,
                          String doctypeSystem)

### Method Detail

#### init

    public void init​(ProcessingContext context,
                     ProcessingComponentConfiguration config)
              throws IOException

Description copied from interface: `Serializer`
Initialize this component.

Specified by:
  `init` in interface `Serializer`
Parameters:
  `context` - The invocation context.
  `config` - The configuration for this component.
Throws:
  `IOException` - in case of problems
See Also:
  `Serializer.init(org.apache.sling.rewriter.ProcessingContext, org.apache.sling.rewriter.ProcessingComponentConfiguration)`

#### dispose

    public void dispose()

Description copied from interface: `Serializer`
Dispose the serializer. This method is always invoked by the rewriter in order to allow the serializer to release any resources etc. After this method has been called the instance is considered unusable.

Specified by:
  `dispose` in interface `Serializer`
See Also:
  `Serializer.dispose()`

#### setDocumentLocator

    public void setDocumentLocator​(Locator locator)

Specified by:
  `setDocumentLocator` in interface `ContentHandler`
See Also:
  `ContentHandler.setDocumentLocator(org.xml.sax.Locator)`

#### startDocument

    public void startDocument()
                       throws SAXException

Specified by:
  `startDocument` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.startDocument()`

#### endDocument

    public void endDocument()
                     throws SAXException

Specified by:
  `endDocument` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.endDocument()`

#### startPrefixMapping

    public void startPrefixMapping​(String prefix,
                                   String uri)
                            throws SAXException

Specified by:
  `startPrefixMapping` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)`

#### endPrefixMapping

    public void endPrefixMapping​(String prefix)
                          throws SAXException

Specified by:
  `endPrefixMapping` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.endPrefixMapping(java.lang.String)`

#### startElement

    public void startElement​(String uri,
                             String loc,
                             String raw,
                             Attributes a)
                      throws SAXException

Specified by:
  `startElement` in interface `ContentHandler`
Throws:
  `SAXException`

#### endElement

    public void endElement​(String uri,
                           String loc,
                           String raw)
                    throws SAXException

Specified by:
  `endElement` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)`

#### characters

    public void characters​(char[] c,
                           int start,
                           int len)
                    throws SAXException

Specified by:
  `characters` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.characters(char[], int, int)`

#### ignorableWhitespace

    public void ignorableWhitespace​(char[] c,
                                    int start,
                                    int len)
                             throws SAXException

Specified by:
  `ignorableWhitespace` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.ignorableWhitespace(char[], int, int)`

#### processingInstruction

    public void processingInstruction​(String target,
                                      String data)
                               throws SAXException

Specified by:
  `processingInstruction` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.processingInstruction(java.lang.String, java.lang.String)`

#### skippedEntity

    public void skippedEntity​(String name)
                       throws SAXException

Specified by:
  `skippedEntity` in interface `ContentHandler`
Throws:
  `SAXException`
See Also:
  `ContentHandler.skippedEntity(java.lang.String)`

#### startDTD

    public void startDTD​(String name,
                         String publicId,
                         String systemId)
                  throws SAXException

Specified by:
  `startDTD` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)`

#### endDTD

    public void endDTD()
                throws SAXException

Specified by:
  `endDTD` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.endDTD()`

#### startEntity

    public void startEntity​(String name)
                     throws SAXException

Specified by:
  `startEntity` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.startEntity(java.lang.String)`

#### endEntity

    public void endEntity​(String name)
                   throws SAXException

Specified by:
  `endEntity` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.endEntity(java.lang.String)`

#### startCDATA

    public void startCDATA()
                    throws SAXException

Specified by:
  `startCDATA` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.startCDATA()`

#### endCDATA

    public void endCDATA()
                  throws SAXException

Specified by:
  `endCDATA` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.endCDATA()`

#### comment

    public void comment​(char[] ch,
                        int start,
                        int len)
                 throws SAXException

Specified by:
  `comment` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.comment(char[], int, int)`