org.jrdf.parser
Interface ParserConfiguration

All Superinterfaces:
StatementHandlerConfiguration
All Known Subinterfaces:
ConfigurableParser
All Known Implementing Classes:
RdfXmlParser

public interface ParserConfiguration
extends StatementHandlerConfiguration

The interface to configure RDF parsers.

Version:
$Revision: 363 $
Author:
Andrew Newman

Field Summary
static int DT_IGNORE
          Constant indicating that datatypes semantics should be ignored.
static int DT_NORMALIZE
          Constant indicating that values of datatyped literals should be normalized to their canonical representation.
static int DT_VERIFY
          Constant indicating that values of datatyped literals should be verified.
 
Method Summary
 void setDatatypeHandling(int datatypeHandling)
          Sets the datatype handling mode.
 void setNamespaceListener(NamespaceListener nl)
          Sets the NamespaceListener that will be notified of any namespace declarations that the parser finds during parsing.
 void setParseErrorListener(ParseErrorListener el)
          Sets the ParseErrorListener that will be notified of any errors that this parser finds during parsing.
 void setParseLocationListener(ParseLocationListener ll)
          Sets the ParseLocationListener that will be notified of the parser's progress during the parse process.
 void setParseStandAloneDocuments(boolean standAloneDocs)
          Sets the parser in a mode to parse stand-alone RDF documents.
 void setPreserveBNodeIds(boolean preserveBNodeIds)
          Set whether the parser should preserve bnode identifiers specified in the source (default is false).
 void setStopAtFirstError(boolean stopAtFirstError)
          Sets whether the parser should stop immediately if it finds an error in the data (default value is true).
 void setVerifyData(boolean verifyData)
          Sets whether the parser should verify the data it parses (default value is true).
 
Methods inherited from interface org.jrdf.parser.StatementHandlerConfiguration
setStatementHandler
 

Field Detail

DT_IGNORE

static final int DT_IGNORE
Constant indicating that datatypes semantics should be ignored.

See Also:
Constant Field Values

DT_VERIFY

static final int DT_VERIFY
Constant indicating that values of datatyped literals should be verified.

See Also:
Constant Field Values

DT_NORMALIZE

static final int DT_NORMALIZE
Constant indicating that values of datatyped literals should be normalized to their canonical representation.

See Also:
Constant Field Values
Method Detail

setParseErrorListener

void setParseErrorListener(ParseErrorListener el)
Sets the ParseErrorListener that will be notified of any errors that this parser finds during parsing.

Parameters:
el - the error listener.

setParseLocationListener

void setParseLocationListener(ParseLocationListener ll)
Sets the ParseLocationListener that will be notified of the parser's progress during the parse process.

Parameters:
ll - the parser location listener.

setNamespaceListener

void setNamespaceListener(NamespaceListener nl)
Sets the NamespaceListener that will be notified of any namespace declarations that the parser finds during parsing.

Parameters:
nl - the namespace listener.

setVerifyData

void setVerifyData(boolean verifyData)
Sets whether the parser should verify the data it parses (default value is true).

Parameters:
verifyData - true to verify the data parsed in.

setPreserveBNodeIds

void setPreserveBNodeIds(boolean preserveBNodeIds)
Set whether the parser should preserve bnode identifiers specified in the source (default is false).

Parameters:
preserveBNodeIds - true to presever blank node identifier.

setParseStandAloneDocuments

void setParseStandAloneDocuments(boolean standAloneDocs)
Sets the parser in a mode to parse stand-alone RDF documents. In stand-alone RDF documents, the enclosing rdf:RDF root element is optional if this root element contains just one element (e.g. rdf:Description.

Parameters:
standAloneDocs - true in standad alone mode.

setStopAtFirstError

void setStopAtFirstError(boolean stopAtFirstError)
Sets whether the parser should stop immediately if it finds an error in the data (default value is true).

Parameters:
stopAtFirstError - true if an error should stop parsing.

setDatatypeHandling

void setDatatypeHandling(int datatypeHandling)
Sets the datatype handling mode. There are three modes for handling datatyped literals: ignore, verify and normalize. If set to ignore, no special action will be taken to handle datatyped literals. If set to verify (the default value), any literals with known (XML Schema built-in) datatypes are checked to see if their values are valid. If set to normalize, the literal values are not only checked, but also normalized to their canonical representation. The default value is verify.

Parameters:
datatypeHandling - One of the constants DT_IGNORE, DT_VERIFY or DT_NORMALIZE.
See Also:
DT_IGNORE, DT_VERIFY, DT_NORMALIZE