|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.ceryle.xtm.XtmHandler
public class XtmHandler
Receives SAX events to process an XTM format document.
This Handler has some known deficiencies, namely, it does not support all attributes on all elements (specifically, it doesn't support id attributes on elements unlikely to need them, ignores all XLink attributes except xlink:href). When the feature is active, XML Namespaces are processed correctly (according to the XTM 1.0 Specification's use of features in the W3C XML Namespaces Recommendation).
This processor does perform some structural checks on elements and attributes, but is non-validating, so invalid source documents may create incorrect in-memory representations and therefore invalid XTM serializations. The SAX parser should be operated in validation mode if there is some question as to the validity of the source documents it may process.
| Field Summary | |
|---|---|
protected Stack |
elementStack
Stack container for element names (Strings), which will precisely reflect the XTM syntax. |
protected Locator |
locator
Document Locator. |
protected MessageHandler |
mh
|
protected XtmNode |
node
The current XtmNode object (a topic, association or mergeMap object). |
protected Stack |
nodeStack
Stack container for nodes (XtmNode objects), which may not reflect the XTM syntax nesting. |
protected XtmNode |
parent
The current XtmNode's parent object. |
static String |
XMLNS_xlink
A String containing the XML Namespace URI for XLink. |
protected XtmProcessor |
xtmp
An XtmProcessor that receives events in the creation of an XTM document. |
| Constructor Summary | |
|---|---|
XtmHandler(Services services,
XtmProcessor xtmp)
Constructor provided with Services and an XtmProcessor. |
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int offset,
int length)
Receive an event indicating the presence of character data. |
void |
comment(char[] ch,
int offset,
int length)
Receive an event indicating the presence of an XML comment. |
void |
endCDATA()
|
void |
endDocument()
Receive an event indicating the end of the document has been reached. |
void |
endDTD()
|
void |
endElement(String uri,
String localpart,
String name)
Receive an event indicating the end tag of an element. |
void |
endEntity(String name)
|
void |
error(SAXParseException spe)
Error. |
void |
fatalError(SAXParseException spe)
Fatal error. |
void |
ignorableWhitespace(char[] ch,
int offset,
int length)
|
protected String |
listNodeStack()
Return a String indicating the node stack contents. |
void |
processingInstruction(String target,
String data)
Receive an event indicating that a processing instruction has been parsed. |
void |
setDocumentLocator(Locator locator)
|
void |
skippedEntity(String name)
|
void |
startCDATA()
|
void |
startDocument()
Receive an event indicating the start of the document. |
void |
startDTD(String name,
String publicId,
String systemId)
Receive an event indicating the presence of a DOCTYPE declaration. |
void |
startElement(String uri,
String localpart,
String name,
Attributes attributes)
Receive an event indicating the start tag of an element and process accordingly. |
void |
startEntity(String name)
|
void |
warning(SAXParseException spe)
Warning. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endPrefixMapping, notationDecl, resolveEntity, startPrefixMapping, unparsedEntityDecl |
| 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 |
|---|
endPrefixMapping, startPrefixMapping |
| Field Detail |
|---|
public static final String XMLNS_xlink
protected MessageHandler mh
protected XtmProcessor xtmp
protected Locator locator
protected Stack elementStack
protected Stack nodeStack
protected XtmNode node
protected XtmNode parent
| Constructor Detail |
|---|
public XtmHandler(Services services,
XtmProcessor xtmp)
| Method Detail |
|---|
public void startElement(String uri,
String localpart,
String name,
Attributes attributes)
startElement in interface ContentHandlerstartElement in class DefaultHandler
public void endElement(String uri,
String localpart,
String name)
throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXException
public void characters(char[] ch,
int offset,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXException
public void comment(char[] ch,
int offset,
int length)
throws SAXException
comment in interface LexicalHandlerSAXException
public void startDTD(String name,
String publicId,
String systemId)
throws SAXException
startDTD in interface LexicalHandlerSAXException
public void startEntity(String name)
throws SAXException
startEntity in interface LexicalHandlerSAXException
public void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXException
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXException
public void endEntity(String name)
throws SAXException
endEntity in interface LexicalHandlerSAXException
public void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionprotected String listNodeStack()
public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandler
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXException
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXException
public void processingInstruction(String target,
String data)
processingInstruction in interface ContentHandlerprocessingInstruction in class DefaultHandler
public void ignorableWhitespace(char[] ch,
int offset,
int length)
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class DefaultHandlerpublic void skippedEntity(String name)
skippedEntity in interface ContentHandlerskippedEntity in class DefaultHandlerpublic void warning(SAXParseException spe)
warning in interface ErrorHandlerwarning in class DefaultHandlerpublic void error(SAXParseException spe)
error in interface ErrorHandlererror in class DefaultHandlerpublic void fatalError(SAXParseException spe)
fatalError in interface ErrorHandlerfatalError in class DefaultHandler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||