| com.hp.hpl.jena.rdf.arp.impl.XMLHandler com.hp.hpl.jena.rdf.arp.impl.SAX2RDFImpl com.hp.hpl.jena.rdf.arp.SAX2RDF
All known Subclasses: com.hp.hpl.jena.rdf.arp.SAX2Model,
SAX2RDF | public class SAX2RDF extends SAX2RDFImpl implements ARPConfig(Code) | |
Allows connecting an arbitrary source of SAX events with ARP.
For use with a DOM tree,
either use
DOM2Model or
see
The Java Developer's Almanac for a discussion of how to transform a DOM
into a source of SAX events.
The use pattern is to create and initialize one of these,
then set it as the content, lexical and error handler
for some source of SAX events (e.g. from a parser).
The parser must be configured to use namespaces, and namespace
prefixes. This initializing can be done for XMLReaders
using
SAX2RDF.installHandlers .
To build a Jena model it is better to use
SAX2Model .
The documentation here, covers usage both using the subclass
SAX2Model , and not.
This class does not support multithreaded SAX sources, nor IO interruption.
There is further documentation:
here
and
here.
author: Jeremy Carroll |
Method Summary | |
public static SAX2RDF | create(String base) Factory method to create a new SAX2RDF.
Use
SAX2RDF.getHandlers or
SAX2RDF.setHandlersWith to provide
a
StatementHandler , and usually an
org.xml.sax.ErrorHandler Parameters: base - The retrieval URL, or the base URI to be used while parsing. | public static SAX2RDF | create(String base, String lang) Factory method to create a new SAX2RDF.
This is particularly
intended for when parsing a non-root element within
an XML document. | public ARPHandlers | getHandlers() The handlers used for processing ARP events. | public ARPOptions | getOptions() | void | initParseX(String base, String lang) | public static void | installHandlers(XMLReader rdr, XMLHandler sax2rdf) Initializes an XMLReader to use the SAX2RDF object
as its handler for all events, and to use namespaces
and namespace prefixes. | public static SAX2RDF | newInstance(String base) Factory method to create a new SAX2RDF. | public static SAX2RDF | newInstance(String base, String lang) Factory method to create a new SAX2RDF.
This is particularly
intended for when parsing a non-root element within
an XML document. | public void | setHandlersWith(ARPHandlers handlers) Copys handlers used for processing ARP events. | public void | setOptionsWith(ARPOptions opts) | public void | startPrefixMapping(String prefix, String uri) Begin the scope of a prefix-URI Namespace mapping.
This is passed to any
NamespaceHandler associated
with this parser.
It can be called before the initial
startElement event, or other events associated
with the elements being processed.
When building a Jena Model, with
SAX2Model it is not required to match this
with corresponding endPrefixMapping events.
Other
NamespaceHandler s may be fussier.
When building a Jena Model, the prefix bindings are
remembered with the Model, and may be used in some
output routines. |
SAX2RDF | SAX2RDF(String base, String lang, boolean dummy)(Code) | | Must call initParse after this.
|
installHandlers | public static void installHandlers(XMLReader rdr, XMLHandler sax2rdf) throws SAXException(Code) | | Initializes an XMLReader to use the SAX2RDF object
as its handler for all events, and to use namespaces
and namespace prefixes.
Parameters: rdr - The XMLReader to initialize. Parameters: sax2rdf - The SAX2RDF instance to use. |
startPrefixMapping | public void startPrefixMapping(String prefix, String uri) throws SAXParseException(Code) | | Begin the scope of a prefix-URI Namespace mapping.
This is passed to any
NamespaceHandler associated
with this parser.
It can be called before the initial
startElement event, or other events associated
with the elements being processed.
When building a Jena Model, with
SAX2Model it is not required to match this
with corresponding endPrefixMapping events.
Other
NamespaceHandler s may be fussier.
When building a Jena Model, the prefix bindings are
remembered with the Model, and may be used in some
output routines. It is permitted to not call this method
for prefixes declared in the outer context, in which case,
any output routine will need to use a gensym for such
namespaces.
Parameters: prefix - The Namespace prefix being declared. Parameters: uri - The Namespace URI the prefix is mapped to. |
Methods inherited from com.hp.hpl.jena.rdf.arp.impl.SAX2RDFImpl | public void characters(char[] ch, int start, int length) throws SAXException(Code)(Java Doc) protected void close()(Code)(Java Doc) public void comment(char[] ch, int start, int length) throws SAXParseException(Code)(Java Doc) public void endCDATA() throws SAXException(Code)(Java Doc) public void endDTD() throws SAXException(Code)(Java Doc) public void endDocument() throws SAXException(Code)(Java Doc) public void endElement(String namespaceURI, String localName, String qName) throws SAXException(Code)(Java Doc) public void endEntity(String name) throws SAXException(Code)(Java Doc) public void endPrefixMapping(String prefix)(Code)(Java Doc) public void error(SAXParseException exception) throws SAXParseException(Code)(Java Doc) public void fatalError(SAXParseException exception) throws SAXException(Code)(Java Doc) public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException(Code)(Java Doc) protected void initParse(String b) throws SAXParseException(Code)(Java Doc) public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc) public void skippedEntity(String name) throws SAXException(Code)(Java Doc) public void startCDATA() throws SAXException(Code)(Java Doc) public void startDTD(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc) public void startDocument() throws SAXException(Code)(Java Doc) public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException(Code)(Java Doc) public void startEntity(String name) throws SAXException(Code)(Java Doc) public void warning(SAXParseException exception) throws SAXParseException(Code)(Java Doc)
|
Methods inherited from com.hp.hpl.jena.rdf.arp.impl.XMLHandler | public boolean allowRelativeURIs()(Code)(Java Doc) public void characters(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void comment(char[] ch, int start, int length) throws SAXParseException(Code)(Java Doc) public void endElement(String uri, String localName, String rawName) throws SAXException(Code)(Java Doc) public void endLocalScope(ANode v)(Code)(Java Doc) public void endPrefixMapping(String prefix)(Code)(Java Doc) public void endRDF()(Code)(Java Doc) public void error(SAXParseException e) throws SAXParseException(Code)(Java Doc) public void fatalError(SAXParseException e) throws SAXException(Code)(Java Doc) public ARPHandlers getHandlers()(Code)(Java Doc) public Locator getLocator()(Code)(Java Doc) public ARPOptions getOptions()(Code)(Java Doc) public static String getSimpleName(Class c)(Code)(Java Doc) public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void initParse(String base, String lang) throws SAXParseException(Code)(Java Doc) protected AbsXMLContext initialContext(String base, String lang) throws SAXParseException(Code)(Java Doc) public boolean isError(int eCode)(Code)(Java Doc) public Location location()(Code)(Java Doc) public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc) public IRI sameDocRef()(Code)(Java Doc) public void setBadStatementHandler(StatementHandler sh)(Code)(Java Doc) public void setDocumentLocator(Locator locator)(Code)(Java Doc) public void setHandlersWith(ARPHandlers newHh)(Code)(Java Doc) public void setOptionsWith(ARPOptions newOpts)(Code)(Java Doc) public void startElement(String uri, String localName, String rawName, Attributes atts) throws SAXException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri) throws SAXParseException(Code)(Java Doc) public void startRDF()(Code)(Java Doc) public void triple(ANode s, ANode p, ANode o)(Code)(Java Doc) public void warning(Taint taintMe, int id, String msg) throws SAXParseException(Code)(Java Doc) public void warning(SAXParseException e) throws SAXParseException(Code)(Java Doc)
|
|
|