Package org.apache.sling.rewriter
Class DefaultTransformer
- java.lang.Object
-
- org.apache.sling.rewriter.DefaultTransformer
-
- All Implemented Interfaces:
Transformer,ContentHandler
public class DefaultTransformer extends Object implements Transformer
A generic base transformer which simply delegates all ContentHandler method invocations to the next ContentHandler.
-
-
Field Summary
Fields Modifier and Type Field Description protected ProcessingComponentConfigurationconfigprotected LocatordocumentLocatorprotected ProcessingContextprocessingContext
-
Constructor Summary
Constructors Constructor Description DefaultTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ac, int i, int j)voiddispose()Dispose the transformer.voidendDocument()voidendElement(String s, String s1, String s2)voidendPrefixMapping(String s)protected ContentHandlergetContentHandler()voidignorableWhitespace(char[] ac, int i, int j)voidinit(ProcessingContext context, ProcessingComponentConfiguration config)Initialize this component.voidprocessingInstruction(String s, String s1)voidsetContentHandler(ContentHandler handler)Set the content handler the transformer should stream to.voidsetDocumentLocator(Locator locator)voidskippedEntity(String s)voidstartDocument()voidstartElement(String s, String s1, String s2, Attributes attributes)voidstartPrefixMapping(String s, String s1)
-
-
-
Field Detail
-
config
protected ProcessingComponentConfiguration config
-
documentLocator
protected Locator documentLocator
-
processingContext
protected ProcessingContext processingContext
-
-
Method Detail
-
characters
public void characters(char[] ac, int i, int j) throws SAXException- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
dispose
public void dispose()
Description copied from interface:TransformerDispose 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:
disposein interfaceTransformer
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
endElement
public void endElement(String s, String s1, String s2) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String s) throws SAXException
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ac, int i, int j) throws SAXException- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
init
public void init(ProcessingContext context, ProcessingComponentConfiguration config) throws IOException
Description copied from interface:TransformerInitialize this component.- Specified by:
initin interfaceTransformer- Parameters:
context- The invocation context.config- The configuration for this component.- Throws:
IOException- in case of any problems
-
processingInstruction
public void processingInstruction(String s, String s1) throws SAXException
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
setContentHandler
public final void setContentHandler(ContentHandler handler)
Description copied from interface:TransformerSet the content handler the transformer should stream to.- Specified by:
setContentHandlerin interfaceTransformer- Parameters:
handler- Another transformer or a serializer.
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
skippedEntity
public void skippedEntity(String s) throws SAXException
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String s, String s1, String s2, Attributes attributes) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String s, String s1) throws SAXException
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
getContentHandler
protected ContentHandler getContentHandler()
-
-