|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.xml.AbstractXMLPipe
org.apache.cocoon.transformation.AbstractTransformer
org.apache.cocoon.transformation.constrained.AbstractConstrainedTransformer
This class is an abstract class from which you can extend your Transformer and write it in a way similar to AWT & Swing Event Handling. Part of this code is from the SQLTransformer of Donald Ball.
Nested Class Summary | |
static class |
AbstractConstrainedTransformer.RipperListener
Utility methods also for subclasses |
Field Summary | |
LexicalHandler |
lexical_handler
The lexical handler of the SAX events generated by this AbstractConstrainedTransformer. |
XMLConsumer |
xml_consumer
The consumer of the SAX events generated by this AbstractConstrainedTransformer. |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
ROLE |
Constructor Summary | |
AbstractConstrainedTransformer()
|
Method Summary | |
void |
addEventListener(ElementEventListener l,
XmlTreeConstraint constraint)
|
void |
characters(char[] ary,
int start,
int length)
Receive notification of character data. |
void |
data(String data)
|
void |
end(String name)
|
void |
endElement(String uri,
String name,
String raw)
Receive notification of the end of an element. |
abstract String |
getName()
Retrieve the 'name' of the namespace this class processes. |
static String |
getStringValue(Object object)
|
abstract String |
getUri()
Retrieve the URI of the namespace this AbstractConstrainedTransformer has to process. |
abstract void |
init(Parameters parameters)
Initialize: set up the listeners etc. |
void |
setDocumentLocator(Locator locator)
Receive an object for locating the origin of SAX document events. |
void |
setup(SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
The Sitemap will call the setup() method to prepare the component for use. |
void |
start(String name)
|
void |
start(String name,
AttributesImpl attr)
|
void |
startElement(String uri,
String name,
String raw,
Attributes attributes)
Receive notification of the beginning of an element. |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
recycle, setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
setConsumer |
Field Detail |
public XMLConsumer xml_consumer
public LexicalHandler lexical_handler
Constructor Detail |
public AbstractConstrainedTransformer()
Method Detail |
public abstract void init(Parameters parameters)
parameters
- The parameters that can be used by this method.public abstract String getUri()
public abstract String getName()
public final void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws ProcessingException, SAXException, IOException
SitemapModelComponent
ObjectModelHelper
for help with the objectModel
.
resolver
- The SourceResolver
to find resources within your context.objectModel
- A java.util.Map
that contains the request and session information.source
- The value of the "src" attribute in the sitemap.parameters
- The sitemap parameters passed into your component.
ProcessingException
- if there is any other unexpected problem.
IOException
- if there is a problem reading files.
SAXException
- if there is a problem reading a SAX stream.public void addEventListener(ElementEventListener l, XmlTreeConstraint constraint)
public void setDocumentLocator(Locator locator)
AbstractXMLPipe
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class AbstractXMLPipe
locator
- An object that can return the location of any SAX
document event.public void startElement(String uri, String name, String raw, Attributes attributes) throws SAXException
AbstractXMLPipe
startElement
in interface ContentHandler
startElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.attributes
- The attributes attached to the element. If there are no
attributes, it shall be an empty Attributes object.
SAXException
public void endElement(String uri, String name, String raw) throws SAXException
AbstractXMLPipe
endElement
in interface ContentHandler
endElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.
SAXException
public void characters(char[] ary, int start, int length) throws SAXException
AbstractXMLPipe
characters
in interface ContentHandler
characters
in class AbstractXMLPipe
ary
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
SAXException
public void start(String name, AttributesImpl attr) throws SAXException
SAXException
public void start(String name) throws SAXException
SAXException
public void end(String name) throws SAXException
SAXException
public void data(String data) throws SAXException
SAXException
public static String getStringValue(Object object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |