|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
info.aduna.clustermap.ClassificationTreeReader
public class ClassificationTreeReader
ClassificationTreeReader is a ContentHandler capable of reconstructing a series of SAX 2.0 events (such as generated by a ClassificationTreeWriter or an XML parser reading an XML SAX file) back into a Classification tree.
ClassificationTreeReader is rather flexible concerning the content it expects. When for example no Classification is specified in the entire stream, a new, empty Classification is constructed that contains all the Objects. When unknown elements or attributes are encountered, they are simply ignored (but be careful not to use existing tag names in different contexts!).
The getTree method, which returns the deserialized Classification tree, has as a side-effect that this ClassificationTreeReader loses its reference to the tree. By that time it has also cleared its internal datastructures. Therefore, after returning the deserialized Classification tree the ClassificationTreeReader is immediately capable of deserializing the next XML stream. A ClassificationTreeReader is also capable of deserializing legacy MapModel serializations. Only the Classification tree of this MapModel will be returned.
| Constructor Summary | |
|---|---|
ClassificationTreeReader()
|
|
| Method Summary | |
|---|---|
void |
characters(char[] chars,
int offset,
int length)
Appends the specified characters to the local StringBuilder. |
void |
endDocument()
Cleans up the intermediate data structures generated in the startDocument method, leaving only a reference to the created Classification tree behind. |
void |
endElement(String uri,
String localName,
String qualifiedName)
Reconstructs the information contained in the element that has just been closed. |
Classification |
getClassificationTree()
Returns the Classification tree generated by this ClassificationTreeReader and sets any internal references to it to 'null'. |
void |
setDocumentLocator(Locator locator)
Locally registers the specified Locator. |
void |
startDocument()
Prepares the ClassificationTreeReader for creating a new Classification tree, based on upcoming SAX events. |
void |
startElement(String uri,
String localName,
String qualifiedName,
Attributes attributes)
startElement implementation, dispatches the call to one of the other "startXXX" methods based on the tag name. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassificationTreeReader()
| Method Detail |
|---|
public Classification getClassificationTree()
public void startDocument()
startDocument in interface ContentHandlerstartDocument in class DefaultHandler
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXExceptionpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandler
public void characters(char[] chars,
int offset,
int length)
characters in interface ContentHandlercharacters in class DefaultHandler
public void startElement(String uri,
String localName,
String qualifiedName,
Attributes attributes)
throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXException
public void endElement(String uri,
String localName,
String qualifiedName)
throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||