RDFParser.DatatypeHandling| Modifier and Type | Field and Description |
|---|---|
protected RDFHandler |
rdfHandler
The RDFHandler that will handle the parsed RDF.
|
| Constructor and Description |
|---|
RDFParserBase()
Creates a new RDFParserBase that will use a
ValueFactoryImpl to
create RDF model objects. |
RDFParserBase(ValueFactory valueFactory)
Creates a new RDFParserBase that will use the supplied ValueFactory to
create RDF model objects.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
RDFParser.DatatypeHandling |
datatypeHandling() |
protected String |
getNamespace(String prefix)
Gets the namespace that is associated with the specified prefix or throws
an
RDFParseException. |
ParseErrorListener |
getParseErrorListener() |
ParseLocationListener |
getParseLocationListener() |
ParserConfig |
getParserConfig()
Retrieves the current parser configuration as a single object.
|
RDFHandler |
getRDFHandler() |
Collection<ParserSetting<?>> |
getSupportedSettings() |
protected boolean |
isValidLanguageTag(String languageTag)
Checks that the supplied language tag conforms to lexical formatting as
specified in RFC-3066.
|
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(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 |
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 |
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(ParsedURI baseURI)
Sets the base URI for resolving relative URIs.
|
protected void |
setBaseURI(String uriSpec)
Parses and normalizes the supplied URI-string and sets it as the base URI
for resolving relative URIs.
|
void |
setDatatypeHandling(RDFParser.DatatypeHandling datatypeHandling)
Sets the datatype handling mode.
|
protected void |
setNamespace(String prefix,
String namespace)
Associates the specified prefix to the specified namespace.
|
void |
setParseErrorListener(ParseErrorListener el)
Sets the ParseErrorListener that will be notified of any errors that this
parser finds during parsing.
|
void |
setParseLocationListener(ParseLocationListener el)
Sets the ParseLocationListener that will be notified of the parser's
progress during the parse process.
|
void |
setParserConfig(ParserConfig config)
Sets all supplied parser configuration options.
|
void |
setPreserveBNodeIDs(boolean preserveBNodeIDs)
Set whether the parser should preserve bnode identifiers specified in the
source (default is false).
|
void |
setRDFHandler(RDFHandler handler)
Sets the RDFHandler that will handle the parsed RDF data.
|
void |
setStopAtFirstError(boolean stopAtFirstError)
Sets whether the parser should stop immediately if it finds an error in
the data (default value is true).
|
void |
setValueFactory(ValueFactory valueFactory)
Sets the ValueFactory that the parser will use to create Value objects for
the parsed RDF data.
|
void |
setVerifyData(boolean verifyData)
Sets whether the parser should verify the data it parses (default value is
true).
|
boolean |
stopAtFirstError() |
boolean |
verifyData() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRDFFormat, parse, parseprotected RDFHandler rdfHandler
public RDFParserBase()
ValueFactoryImpl to
create RDF model objects.public RDFParserBase(ValueFactory valueFactory)
valueFactory - A ValueFactory.public void setValueFactory(ValueFactory valueFactory)
RDFParsersetValueFactory in interface RDFParservalueFactory - The value factory that the parser should use.public void setRDFHandler(RDFHandler handler)
RDFParsersetRDFHandler in interface RDFParserpublic RDFHandler getRDFHandler()
public void setParseErrorListener(ParseErrorListener el)
RDFParsersetParseErrorListener in interface RDFParserpublic ParseErrorListener getParseErrorListener()
public void setParseLocationListener(ParseLocationListener el)
RDFParsersetParseLocationListener in interface RDFParserpublic ParseLocationListener getParseLocationListener()
public void setParserConfig(ParserConfig config)
RDFParsersetParserConfig in interface RDFParserconfig - a parser configuration object.public ParserConfig getParserConfig()
RDFParsergetParserConfig in interface RDFParserpublic Collection<ParserSetting<?>> getSupportedSettings()
getSupportedSettings in interface RDFParserParserSettings that are supported by this
RDFParser.public void setVerifyData(boolean verifyData)
RDFParsersetVerifyData in interface RDFParserpublic boolean verifyData()
public void setPreserveBNodeIDs(boolean preserveBNodeIDs)
RDFParsersetPreserveBNodeIDs in interface RDFParserpublic boolean preserveBNodeIDs()
public void setStopAtFirstError(boolean stopAtFirstError)
RDFParsersetStopAtFirstError in interface RDFParserpublic boolean stopAtFirstError()
public void setDatatypeHandling(RDFParser.DatatypeHandling datatypeHandling)
RDFParsersetDatatypeHandling in interface RDFParserdatatypeHandling - A datatype handling option.public RDFParser.DatatypeHandling datatypeHandling()
protected void setBaseURI(String uriSpec)
protected void setBaseURI(ParsedURI baseURI)
protected void setNamespace(String prefix, String namespace)
protected String getNamespace(String prefix) throws RDFParseException
RDFParseException.RDFParseException - if no namespace is associated with this prefixprotected void clear()
protected void clearBNodeIDMap()
protected URI resolveURI(String uriSpec) throws RDFParseException
URI
object for it.RDFParseExceptionprotected URI createURI(String uri) throws RDFParseException
URI object for the specified URI-string.RDFParseExceptionprotected BNode createBNode() throws RDFParseException
BNode object.RDFParseExceptionprotected BNode createBNode(String nodeID) throws RDFParseException
BNode object for the specified identifier.RDFParseExceptionprotected Literal createLiteral(String label, String lang, URI datatype) throws RDFParseException
Literal object with the supplied parameters.RDFParseExceptionprotected boolean isValidLanguageTag(String languageTag)
languageTag - protected Statement createStatement(Resource subj, URI pred, Value obj) throws RDFParseException
Statement object with the supplied components.RDFParseExceptionprotected Statement createStatement(Resource subj, URI pred, Value obj, Resource context) throws RDFParseException
Statement object with the supplied components.RDFParseExceptionprotected void reportLocation(int lineNo,
int columnNo)
ParseLocationListener, if any.protected void reportWarning(String msg)
reportWarning(String,int,int) supplying
-1 for the line- and column number.protected void reportWarning(String msg, int lineNo, int columnNo)
protected void reportError(String msg) throws RDFParseException
reportError(String,int,int) supplying -1
for the line- and column number. This method throws a
ParseException when 'stop-at-first-error' has been set to
true.RDFParseExceptionsetStopAtFirstError(boolean)protected void reportError(String msg, int lineNo, int columnNo) throws RDFParseException
RDFParseExceptionsetStopAtFirstError(boolean)protected void reportFatalError(String msg) throws RDFParseException
reportFatalError(String,int,int) supplying -1 for the
line- and column number.RDFParseExceptionprotected void reportFatalError(String msg, int lineNo, int columnNo) throws RDFParseException
RDFParseExceptionprotected void reportFatalError(Exception e) throws RDFParseException
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 reportFatalError(Exception,int,int)
supplying -1 for the line- and column number.
RDFParseExceptionprotected void reportFatalError(Exception e, int lineNo, int columnNo) throws RDFParseException
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.RDFParseExceptionCopyright © 2001-2013 Aduna. All Rights Reserved.