org.apache.hivemind.sdl
Class SDLResourceParser
java.lang.Object
|
+--org.apache.hivemind.sdl.SDLResourceParser
- public class SDLResourceParser
- extends java.lang.Object
Wrapper around SimpleDataLanguageParser
(which is generated code). Parses resources that contained Simple Data Language - a language
inspired by XML, but rationalized for storing hiearachical data (a frequent application of XML,
even though XML is better suited for rich document markup than storing of data). SDL
is isomorphic to a subset of XML: It has equivalents for XML elements, XML attributes,
and parsable character data (text within an element), but does not support processing
instructions, namespaces, internal or external entities, doctype, etc.
- Author:
- Howard Lewis Ship
Method Summary |
void |
parseResource(Resource resource,
org.xml.sax.ContentHandler handler)
Parses the resource, passing SAX parse events to the handler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SDLResourceParser
public SDLResourceParser()
parseResource
public void parseResource(Resource resource,
org.xml.sax.ContentHandler handler)
throws org.xml.sax.SAXParseException,
java.io.IOException
- Parses the resource, passing SAX parse events to the handler. SDL does
not (at this time) support namespaces or other constructs of XML, so only
the following methods of ContentHandler will be invoked:
ContentHandler.setDocumentLocator(org.xml.sax.Locator)
- before any other calls
ContentHandler.startDocument()
- {@link ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
- passing only the local name (namespace URL and qname will be null)
- {@link ContentHandler#characters(char[], int, int) for literal (and extended literal) strings
- {@link ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String) - again, with the namespace
parameters passed as null
- {@link ContentHandler#endDocument() - last
At some future point, SDL may support more XML-like things, including names spaces.
org.xml.sax.SAXParseException
java.io.IOException