|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--org.w3c.rdf.util.xml.GenericParser
Field Summary | |
protected RDFConsumer |
consumer
|
protected Element |
current
|
protected ErrorHandler |
errorHandler
|
protected Locator |
locator
|
protected java.util.Hashtable |
namespaces
|
protected NodeFactory |
nodeFactory
|
static java.lang.String |
REVISION
|
protected InputSource |
source
|
Constructor Summary | |
GenericParser()
|
|
GenericParser(boolean warn)
|
Method Summary | |
protected void |
_endElement(java.lang.String uri,
java.lang.String name)
|
protected static void |
_main(java.lang.String url,
RDFParser parser)
|
protected void |
_startElement(java.lang.String uri,
java.lang.String name,
Attributes al)
|
void |
addError(java.lang.String sMsg)
Generate an error message as a string |
protected void |
addNamespace(java.lang.String uri)
|
void |
addWarning(java.lang.String sMsg)
Generate a warning message as a string |
void |
characters(char[] ch,
int start,
int length)
Receive notification of character data. |
protected Element |
createElement()
|
static XMLReader |
createParser(java.lang.String className)
|
protected Statement |
createStatement(Resource subject,
Resource predicate,
RDFNode object)
|
void |
endElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName)
Receive notification of the end of an element. |
static InputSource |
getInputSource(java.lang.String urlStr)
|
java.util.Enumeration |
getNamespaces()
|
protected java.lang.String |
getSourceURI()
|
protected void |
initXMLParser(boolean warn)
|
static void |
main(java.lang.String[] args)
|
void |
parse(InputSource source,
RDFConsumer consumer)
Parse from the given SAX/XML input source. |
protected boolean |
preserveWhiteSpace()
|
void |
setErrorHandler(ErrorHandler handler)
|
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
Attributes atts)
Receive notification of the beginning of an element. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String REVISION
protected ErrorHandler errorHandler
protected Locator locator
protected InputSource source
protected Element current
protected NodeFactory nodeFactory
protected RDFConsumer consumer
protected java.util.Hashtable namespaces
Constructor Detail |
public GenericParser()
public GenericParser(boolean warn)
Method Detail |
protected void initXMLParser(boolean warn)
public void addWarning(java.lang.String sMsg) throws SAXException
public void addError(java.lang.String sMsg) throws SAXException
public void setErrorHandler(ErrorHandler handler)
setErrorHandler
in interface RDFParser
protected java.lang.String getSourceURI()
public void startElement(java.lang.String uri, java.lang.String name, java.lang.String qName, Attributes atts) throws SAXException
ContentHandler
The Parser will invoke this method at the beginning of every
element in the XML document; there will be a corresponding
endElement
event for every startElement event
(even when the element is empty). All of the element's content will be
reported, in order, before the corresponding endElement
event.
This event allows up to three name components for each element:
Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
Note that the attribute list provided will contain only
attributes with explicit values (specified or defaulted):
#IMPLIED attributes will be omitted. The attribute list
will contain attributes used for Namespace declarations
(xmlns* attributes) only if the
http://xml.org/sax/features/namespace-prefixes
property is true (it is false by default, and support for a
true value is optional).
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.ContentHandler
uri
- The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.localName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.qName
- The qualified name (with prefix), or the
empty string if qualified names are not available.atts
- The attributes attached to the element. If
there are no attributes, it shall be an empty
Attributes object.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
,
Attributes
public java.util.Enumeration getNamespaces()
protected void addNamespace(java.lang.String uri)
protected void _startElement(java.lang.String uri, java.lang.String name, Attributes al) throws SAXException
protected Element createElement()
public void endElement(java.lang.String uri, java.lang.String name, java.lang.String qName) throws SAXException
ContentHandler
The SAX parser will invoke this method at the end of every
element in the XML document; there will be a corresponding
startElement
event for every endElement
event (even when the element is empty).
For information on the names, see startElement.
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.ContentHandler
uri
- The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed.localName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.qName
- The qualified XML 1.0 name (with prefix), or the
empty string if qualified names are not available.SAXException
- Any SAX exception, possibly
wrapping another exception.protected void _endElement(java.lang.String uri, java.lang.String name) throws SAXException
protected boolean preserveWhiteSpace()
public void characters(char[] ch, int start, int length) throws SAXException
ContentHandler
The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
The application must not attempt to read from the array outside of the specified range.
Note that some parsers will report whitespace in element
content using the ignorableWhitespace
method rather than this one (validating parsers must
do so).
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.ContentHandler
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.ignorableWhitespace(char[], int, int)
,
Locator
protected Statement createStatement(Resource subject, Resource predicate, RDFNode object) throws ModelException
public static XMLReader createParser(java.lang.String className)
public void parse(InputSource source, RDFConsumer consumer) throws SAXException
RDFParser
parse
in interface RDFParser
public static InputSource getInputSource(java.lang.String urlStr) throws java.net.MalformedURLException, java.io.IOException
protected static void _main(java.lang.String url, RDFParser parser) throws java.io.IOException, java.net.MalformedURLException
public static void main(java.lang.String[] args) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |