com.hp.hpl.jena.rdf.arp
Class ARPOptions

java.lang.Object
  extended by com.hp.hpl.jena.rdf.arp.ARPOptions
All Implemented Interfaces:
ARPErrorNumbers

public class ARPOptions
extends Object
implements ARPErrorNumbers

Configure error reporting options etc on ARP, SAX2RDF and SAX2Model instances.

Author:
Jeremy J. Carroll

Field Summary
 
Fields inherited from interface com.hp.hpl.jena.rdf.arp.ARPErrorNumbers
EM_ERROR, EM_FATAL, EM_IGNORE, EM_WARNING, ERR_ABOUTEACH_NOT_TOPLEVEL, ERR_BAD_RDF_ATTRIBUTE, ERR_BAD_RDF_ELEMENT, ERR_ENCODING_MISMATCH, ERR_GENERIC_IO, ERR_INTERNAL_ERROR, ERR_LI_AS_TYPE, ERR_NOT_WHITESPACE, ERR_RESOLVING_URI_AGAINST_NULL_BASE, ERR_SAX_ERROR, ERR_SAX_FATAL_ERROR, ERR_STRING_NOT_NORMAL_FORM_C, ERR_SYNTAX_ERROR, ERR_UNABLE_TO_RECOVER, ERR_URI_NOT_NORMAL_FORM_C, ERR_UTF_ENCODING, IGN_DAML_COLLECTION, IGN_NO_BASE_URI_SPECIFIED, IGN_PRIVATE_XMLLANG, IGN_XMLBASE_SIGNIFICANT, IGN_XMLBASE_USED, WARN_BAD_NAME, WARN_BAD_NAMESPACE_URI, WARN_BAD_RDF_NAMESPACE_URI, WARN_BAD_XML, WARN_BAD_XML_NAMESPACE_URI, WARN_BAD_XMLLANG, WARN_DEPRECATED_XMLLANG, WARN_ENCODING_MISMATCH, WARN_IN_STRICT_MODE, WARN_LEGAL_REUSE_OF_ID, WARN_MALFORMED_URI, WARN_MALFORMED_XMLLANG, WARN_MINOR_INTERNAL_ERROR, WARN_PROCESSING_INSTRUCTION_IN_RDF, WARN_QNAME_AS_ID, WARN_RDF_NN_AS_TYPE, WARN_REDEFINITION_OF_ID, WARN_RELATIVE_NAMESPACE_URI_DEPRECATED, WARN_RESOLVING_URI_AGAINST_EMPTY_BASE, WARN_SAX_WARNING, WARN_STRING_COMPOSING_CHAR, WARN_STRING_NOT_NORMAL_FORM_C, WARN_UNKNOWN_PARSETYPE, WARN_UNKNOWN_RDF_ATTRIBUTE, WARN_UNKNOWN_RDF_ELEMENT, WARN_UNKNOWN_XML_ATTRIBUTE, WARN_UNQUALIFIED_ATTRIBUTE, WARN_UNQUALIFIED_ELEMENT, WARN_UNQUALIFIED_RDF_ATTRIBUTE, WARN_URI_COMPOSING_CHAR, WARN_XMLBASE_MISSING
 
Constructor Summary
ARPOptions()
           
 
Method Summary
 void setDefaultErrorMode()
          Resets error mode to the default values: most errors are reported as warnings, but triples are produced.
 boolean setEmbedding(boolean embed)
          Sets whether the XML document is only RDF, or contains RDF embedded in other XML.
 int setErrorMode(int errno, int mode)
          Sets or gets the error handling mode for a specific error condition.
 void setLaxErrorMode()
          As many errors as possible are ignored.
 void setStrictErrorMode()
          This method tries to emulate the latest Working Group recommendations.
 void setStrictErrorMode(int nonErrorMode)
          This method detects and prohibits errors according to the latest Working Group recommendations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARPOptions

public ARPOptions()
Method Detail

setErrorMode

public int setErrorMode(int errno,
                        int mode)
Sets or gets the error handling mode for a specific error condition. Changes that cannot be honoured are silently ignored. Illegal error numbers may result in an ArrayIndexOutOfBoundsException but are usually ignored.

Parameters:
errno - The specific error condition to change.
mode - The new mode one of:
IGNORE
Ignore this condition.
WARNING
Invoke ErrorHandler.warning() for this condition.
ERROR
Invoke ErrorHandler.error() for this condition.
FATAL
Aborts parse and invokes ErrorHandler.fatalError() for this condition. In unusual situations, a few further warnings and errors may be reported.
Returns:
The old error mode for this condition.

setDefaultErrorMode

public void setDefaultErrorMode()
Resets error mode to the default values: most errors are reported as warnings, but triples are produced.


setLaxErrorMode

public void setLaxErrorMode()
As many errors as possible are ignored. As many triples as possible are produced.


setStrictErrorMode

public void setStrictErrorMode()
This method tries to emulate the latest Working Group recommendations.


setStrictErrorMode

public void setStrictErrorMode(int nonErrorMode)
This method detects and prohibits errors according to the latest Working Group recommendations. For other conditions, such as ARPErrorNumbers.WARN_PROCESSING_INSTRUCTION_IN_RDF and ARPErrorNumbers.WARN_LEGAL_REUSE_OF_ID, nonErrorMode is used.

Parameters:
nonErrorMode - The way of treating non-error conditions.

setEmbedding

public boolean setEmbedding(boolean embed)
Sets whether the XML document is only RDF, or contains RDF embedded in other XML. The default is non-embedded mode. Embedded mode also matches RDF documents that use the rdf:RDF tag at the top-level. Non-embeded mode matches RDF documents which omit that optional tag, and consist of a single rdf:Description or typed node. To find embedded RDF it is necessary to setEmbedding(true).

Parameters:
embed - true: Look for embedded RDF; or false: match a typed node or rdf:Description against the whole document (the default).
Returns:
Previous setting.


Copyright © 2000, 2001, 2002, 2003, 2004 Hewlett-Packard Development Company, LP