Package org.apache.sling.rewriter
Class DefaultTransformer
- java.lang.Object
-
- org.apache.sling.rewriter.DefaultTransformer
-
- All Implemented Interfaces:
Transformer
,org.xml.sax.ContentHandler
public class DefaultTransformer extends java.lang.Object implements Transformer
A generic base transformer which simply delegates all ContentHandler method invocations to the next ContentHandler.
-
-
Constructor Summary
Constructors Constructor Description DefaultTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ac, int i, int j)
void
dispose()
Dispose the transformer.void
endDocument()
void
endElement(java.lang.String s, java.lang.String s1, java.lang.String s2)
void
endPrefixMapping(java.lang.String s)
void
ignorableWhitespace(char[] ac, int i, int j)
void
init(ProcessingContext context, ProcessingComponentConfiguration config)
Initialize this component.void
processingInstruction(java.lang.String s, java.lang.String s1)
void
setContentHandler(org.xml.sax.ContentHandler handler)
Set the content handler the transformer should stream to.void
setDocumentLocator(org.xml.sax.Locator locator)
void
skippedEntity(java.lang.String s)
void
startDocument()
void
startElement(java.lang.String s, java.lang.String s1, java.lang.String s2, org.xml.sax.Attributes attributes)
void
startPrefixMapping(java.lang.String s, java.lang.String s1)
-
-
-
Method Detail
-
characters
public void characters(char[] ac, int i, int j) throws org.xml.sax.SAXException
- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
dispose
public void dispose()
Description copied from interface:Transformer
Dispose the transformer. This method is always invoked by the rewriter in order to allow the transformer to release any resources etc. After this method has been called the instance is considered unusable.- Specified by:
dispose
in interfaceTransformer
-
endDocument
public void endDocument() throws org.xml.sax.SAXException
- Specified by:
endDocument
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String s, java.lang.String s1, java.lang.String s2) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
endPrefixMapping
public void endPrefixMapping(java.lang.String s) throws org.xml.sax.SAXException
- Specified by:
endPrefixMapping
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ac, int i, int j) throws org.xml.sax.SAXException
- Specified by:
ignorableWhitespace
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
init
public void init(ProcessingContext context, ProcessingComponentConfiguration config) throws java.io.IOException
Description copied from interface:Transformer
Initialize this component.- Specified by:
init
in interfaceTransformer
- Parameters:
context
- The invocation context.config
- The configuration for this component.- Throws:
java.io.IOException
-
processingInstruction
public void processingInstruction(java.lang.String s, java.lang.String s1) throws org.xml.sax.SAXException
- Specified by:
processingInstruction
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
setContentHandler
public final void setContentHandler(org.xml.sax.ContentHandler handler)
Description copied from interface:Transformer
Set the content handler the transformer should stream to.- Specified by:
setContentHandler
in interfaceTransformer
- Parameters:
handler
- Another transformer or a serializer.
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Specified by:
setDocumentLocator
in interfaceorg.xml.sax.ContentHandler
-
skippedEntity
public void skippedEntity(java.lang.String s) throws org.xml.sax.SAXException
- Specified by:
skippedEntity
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
startDocument
public void startDocument() throws org.xml.sax.SAXException
- Specified by:
startDocument
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String s, java.lang.String s1, java.lang.String s2, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
startPrefixMapping
public void startPrefixMapping(java.lang.String s, java.lang.String s1) throws org.xml.sax.SAXException
- Specified by:
startPrefixMapping
in interfaceorg.xml.sax.ContentHandler
- Throws:
org.xml.sax.SAXException
-
-