| java.lang.Object org.openrdf.rio.helpers.RDFParserBase
All known Subclasses: org.openrdf.rio.rdfxml.RDFXMLParser, org.openrdf.rio.trix.TriXParser, org.openrdf.rio.ntriples.NTriplesParser, org.openrdf.rio.turtle.TurtleParser,
RDFParserBase | abstract public class RDFParserBase implements RDFParser(Code) | | Base class for
RDFParser s offering common functionality for RDF
parsers.
author: Arjohn Kampman |
Constructor Summary | |
public | RDFParserBase() Creates a new RDFParserBase that will use a
ValueFactoryImpl to
create RDF model objects. | public | RDFParserBase(ValueFactory valueFactory) Creates a new TurtleParser that will use the supplied ValueFactory to
create RDF model objects. |
Method Summary | |
protected void | clear() Clears any information that has been collected while parsing. | protected void | clearBNodeIDMap() Clears the map that keeps track of blank nodes that have been parsed. | protected BNode | createBNode() Creates a new
BNode object. | protected BNode | createBNode(String nodeID) Creates a
BNode object for the specified identifier. | protected Literal | createLiteral(String label, String lang, URI datatype) Creates a
Literal object with the supplied parameters. | protected Statement | createStatement(Resource subj, URI pred, Value obj) Creates a new
Statement object with the supplied components. | protected Statement | createStatement(Resource subj, URI pred, Value obj, Resource context) Creates a new
Statement object with the supplied components. | protected URI | createURI(String uri) Creates a
URI object for the specified URI-string. | public DatatypeHandling | datatypeHandling() | protected String | getNamespace(String prefix) Gets the namespace that is associated with the specified prefix, if any. | public ParseErrorListener | getParseErrorListener() | public ParseLocationListener | getParseLocationListener() | public RDFHandler | getRDFHandler() | public boolean | preserveBNodeIDs() | protected void | reportError(String msg) Reports an error to the registered ParseErrorListener, if any. | protected void | reportError(String msg, int lineNo, int columnNo) Reports an error with associated line- and column number to the registered
ParseErrorListener, if any. | protected void | reportFatalError(String msg) Reports a fatal error to the registered ParseErrorListener, if any, and
throws a ParseException afterwards. | protected void | reportFatalError(String msg, int lineNo, int columnNo) Reports a fatal error with associated line- and column number to the
registered ParseErrorListener, if any, and throws a
ParseException afterwards. | protected void | reportFatalError(Exception e) Reports a fatal error to the registered ParseErrorListener, if any, and
throws a ParseException afterwards. | protected void | reportFatalError(Exception e, int lineNo, int columnNo) Reports a fatal error with associated line- and column number to the
registered ParseErrorListener, if any, and throws a
ParseException wrapped the supplied exception afterwards. | protected void | reportLocation(int lineNo, int columnNo) Reports the specified line- and column number to the registered
ParseLocationListener , if any. | protected void | reportWarning(String msg) Reports a warning to the registered ParseErrorListener, if any. | protected void | reportWarning(String msg, int lineNo, int columnNo) Reports a warning with associated line- and column number to the
registered ParseErrorListener, if any. | protected URI | resolveURI(String uriSpec) Resolves a URI-string against the base URI and creates a
URI object for it. | protected void | setBaseURI(String uriSpec) Parses and normalizes the supplied URI-string and sets it as the base URI
for resolving relative URIs. | protected void | setBaseURI(ParsedURI baseURI) Sets the base URI for resolving relative URIs. | public void | setDatatypeHandling(DatatypeHandling datatypeHandling) | protected void | setNamespace(String prefix, String namespace) Associates the specified prefix to the specified namespace. | public void | setParseErrorListener(ParseErrorListener el) | public void | setParseLocationListener(ParseLocationListener el) | public void | setPreserveBNodeIDs(boolean preserveBNodeIDs) | public void | setRDFHandler(RDFHandler handler) | public void | setStopAtFirstError(boolean stopAtFirstError) | public void | setValueFactory(ValueFactory valueFactory) | public void | setVerifyData(boolean verifyData) | public boolean | stopAtFirstError() | public boolean | verifyData() |
rdfHandler | protected RDFHandler rdfHandler(Code) | | The RDFHandler that will handle the parsed RDF.
|
RDFParserBase | public RDFParserBase()(Code) | | Creates a new RDFParserBase that will use a
ValueFactoryImpl to
create RDF model objects.
|
RDFParserBase | public RDFParserBase(ValueFactory valueFactory)(Code) | | Creates a new TurtleParser that will use the supplied ValueFactory to
create RDF model objects.
Parameters: valueFactory - A ValueFactory. |
clear | protected void clear()(Code) | | Clears any information that has been collected while parsing. This method
must be called by subclasses when finishing the parse process.
|
clearBNodeIDMap | protected void clearBNodeIDMap()(Code) | | Clears the map that keeps track of blank nodes that have been parsed.
Normally, this map is clear when the document has been parsed completely,
but subclasses can clear the map at other moments too, for example when a
bnode scope ends.
|
datatypeHandling | public DatatypeHandling datatypeHandling()(Code) | | |
getNamespace | protected String getNamespace(String prefix)(Code) | | Gets the namespace that is associated with the specified prefix, if any.
|
preserveBNodeIDs | public boolean preserveBNodeIDs()(Code) | | |
reportError | protected void reportError(String msg, int lineNo, int columnNo) throws RDFParseException(Code) | | Reports an error with associated line- and column number to the registered
ParseErrorListener, if any. This method throws a ParseException
when 'stop-at-first-error' has been set to true.
See Also: RDFParserBase.setStopAtFirstError |
reportFatalError | protected void reportFatalError(String msg, int lineNo, int columnNo) throws RDFParseException(Code) | | Reports a fatal error with associated line- and column number to the
registered ParseErrorListener, if any, and throws a
ParseException afterwards.
|
reportFatalError | protected void reportFatalError(Exception e) throws RDFParseException(Code) | | Reports a fatal error to the registered ParseErrorListener, if any, and
throws a ParseException afterwards. An exception is made for
the case where the supplied exception is a
RDFParseException ; in
that case the supplied exception is not wrapped in another ParseException
and the error message is not reported to the ParseErrorListener, assuming
that it has already been reported when the original ParseException was
thrown.
This method simply calls
RDFParserBase.reportFatalError(Exception,int,int) supplying -1 for the line- and column number.
|
reportFatalError | protected void reportFatalError(Exception e, int lineNo, int columnNo) throws RDFParseException(Code) | | Reports a fatal error with associated line- and column number to the
registered ParseErrorListener, if any, and throws a
ParseException wrapped the supplied exception afterwards. An
exception is made for the case where the supplied exception is a
RDFParseException ; in that case the supplied exception is not
wrapped in another ParseException and the error message is not reported to
the ParseErrorListener, assuming that it has already been reported when
the original ParseException was thrown.
|
reportLocation | protected void reportLocation(int lineNo, int columnNo)(Code) | | Reports the specified line- and column number to the registered
ParseLocationListener , if any.
|
reportWarning | protected void reportWarning(String msg, int lineNo, int columnNo)(Code) | | Reports a warning with associated line- and column number to the
registered ParseErrorListener, if any.
|
setBaseURI | protected void setBaseURI(String uriSpec)(Code) | | Parses and normalizes the supplied URI-string and sets it as the base URI
for resolving relative URIs.
|
setBaseURI | protected void setBaseURI(ParsedURI baseURI)(Code) | | Sets the base URI for resolving relative URIs.
|
setDatatypeHandling | public void setDatatypeHandling(DatatypeHandling datatypeHandling)(Code) | | |
setNamespace | protected void setNamespace(String prefix, String namespace)(Code) | | Associates the specified prefix to the specified namespace.
|
setPreserveBNodeIDs | public void setPreserveBNodeIDs(boolean preserveBNodeIDs)(Code) | | |
setStopAtFirstError | public void setStopAtFirstError(boolean stopAtFirstError)(Code) | | |
setVerifyData | public void setVerifyData(boolean verifyData)(Code) | | |
stopAtFirstError | public boolean stopAtFirstError()(Code) | | |
verifyData | public boolean verifyData()(Code) | | |
|
|