Package org.apache.sling.rewriter
Interface Generator
-
public interface Generator
TheGenerator
interface defines the start of a rewriter pipeline. A generator is not a component managed by the container (OSGi). AGeneratorFactory
is a service managed by the container which creates generator instances on demand.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispose()
Dispose the generator.void
finished()
Notify the generator that parsing is finished.java.io.PrintWriter
getWriter()
Get the writer to write the output to.void
init(ProcessingContext context, ProcessingComponentConfiguration config)
Initialize this component.void
setContentHandler(org.xml.sax.ContentHandler handler)
Set the content handler the generator should stream to.
-
-
-
Method Detail
-
init
void init(ProcessingContext context, ProcessingComponentConfiguration config) throws java.io.IOException
Initialize this component.- Parameters:
context
- The invocation context.config
- The configuration for this component.- Throws:
java.io.IOException
-
setContentHandler
void setContentHandler(org.xml.sax.ContentHandler handler)
Set the content handler the generator should stream to.- Parameters:
handler
- A transformer or serializer.
-
getWriter
java.io.PrintWriter getWriter()
Get the writer to write the output to.- Returns:
- A print writer.
-
finished
void finished() throws java.io.IOException, org.xml.sax.SAXException
Notify the generator that parsing is finished.- Throws:
java.io.IOException
org.xml.sax.SAXException
-
dispose
void dispose()
Dispose the generator. This method is always invoked by the rewriter in order to allow the generator to release any resources etc. After this method has been called the instance is considered unusable.
-
-