|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.oroad.stxx.util.AbstractSAXFilter com.oroad.stxx.util.AbstractSAXTransformer
Derived from Apache Cocoon: This class is the basis for all transformers. It provides various useful methods and hooks for implementing own custom transformers.
The basic behaviour of each transformer consists of the following four parts:
For all these four purposes the AbstractSAXTransformer offers some powerful methods and hooks:
Namespace handling
By setting the instance variable namespaceURI to the namespace the events are filtered and only events with this namespace are send to the two hooks startTransformingElement() and endTransformingElement().
It is possible to override the default namespace for the transformer by specifying the parameter "namespaceURI" in the pipeline. This avoids possible namespace collisions.
Recording of information
There are several methods for recording information, e.g. startRecording(), startTextRecording() etc. These methods collect information from the xml stream for further processing.
Creating new events
New events can be easily created with the sendEvents()
method,
the sendStartElementEvent()
methods, the sendEndElementEvent()
method or the sendTextEvent()
method.
Initialization
Before the document is processed the setupTransforming() hook is invoked.
Field Summary | |
protected java.lang.String |
systemID
Description of the Field |
protected javax.xml.transform.Transformer |
transformer
Description of the Field |
Fields inherited from class com.oroad.stxx.util.AbstractSAXFilter |
contentHandler, lexicalHandler |
Constructor Summary | |
AbstractSAXTransformer()
|
Method Summary | |
java.lang.String |
getSystemId()
Gets the systemId attribute of the AbstractSAXTransformer object |
javax.xml.transform.Transformer |
getTransformer()
Gets the transformer attribute of the AbstractSAXTransformer object |
void |
notationDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Description of the Method |
void |
setResult(javax.xml.transform.Result result)
Sets the result attribute of the AbstractSAXTransformer object |
void |
setSystemId(java.lang.String newSystemID)
Sets the systemId attribute of the AbstractSAXTransformer object |
void |
unparsedEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName)
Description of the Method |
Methods inherited from class com.oroad.stxx.util.AbstractSAXFilter |
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, setLexicalHandler, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping |
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 |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Field Detail |
protected java.lang.String systemID
protected javax.xml.transform.Transformer transformer
Constructor Detail |
public AbstractSAXTransformer()
Method Detail |
public void setResult(javax.xml.transform.Result result) throws java.lang.IllegalArgumentException
setResult
in interface javax.xml.transform.sax.TransformerHandler
result
- The new result value
java.lang.IllegalArgumentException
- Description of the Exceptionpublic void setSystemId(java.lang.String newSystemID)
setSystemId
in interface javax.xml.transform.sax.TransformerHandler
newSystemID
- The new systemId valuepublic java.lang.String getSystemId()
getSystemId
in interface javax.xml.transform.sax.TransformerHandler
public javax.xml.transform.Transformer getTransformer()
getTransformer
in interface javax.xml.transform.sax.TransformerHandler
public void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
notationDecl
in interface org.xml.sax.DTDHandler
name
- Description of the ParameterpublicId
- Description of the ParametersystemId
- Description of the Parameter
org.xml.sax.SAXException
- Description of the Exceptionpublic void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName) throws org.xml.sax.SAXException
unparsedEntityDecl
in interface org.xml.sax.DTDHandler
name
- Description of the ParameterpublicId
- Description of the ParametersystemId
- Description of the ParameternotationName
- Description of the Parameter
org.xml.sax.SAXException
- Description of the Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |