| java.lang.Object com.hp.hpl.jena.rdf.arp.ARPOptions
ARPOptions | public class ARPOptions implements ARPErrorNumbers(Code) | | The interface to set the various options on ARP.
User defined
implementations of this interface are not supported. This is a class rather
than an interface to have better backward compatibilitiy with earlier
versions, however constructing instances of this class is deprecated.
In addition, accessing the fields of
ARPErrorNumbers through this
class is not supported. The inheritance of this interface will be removed.
author: Jeremy J. Carroll |
Constructor Summary | |
public | ARPOptions() Do not use this constructor. |
Method Summary | |
public ARPOptions | copy() Copies this object. | public boolean | getEmbedding() True if the embedding flag is set. | public int | getErrorMode(int eCode) Returns the error mode for the given error code. | public void | setDefaultErrorMode() Resets error mode to the default values:
many errors are reported as warnings, and resulting triples are produced. | 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). | 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.
Most conditions are associated with one or more specific resources or literals
formed during the parse. | public void | setLaxErrorMode() As many errors as possible are ignored. | public void | setStrictErrorMode() This sets strict conformance to the W3C Recommendations. | public void | setStrictErrorMode(int nonErrorMode) This method detects and prohibits errors according to
the W3C Recommendations.
For other conditions, such as
ARPErrorNumbers.WARN_PROCESSING_INSTRUCTION_IN_RDF , nonErrorMode is used. |
ARPOptions | public ARPOptions()(Code) | | Do not use this constructor.
An example of not using this constructor is as follows.
Deprecated usage:
ARP arp = new ARP();
ARPOptions options = new ARPOptions();
Preferred code:
ARP arp = new ARP();
ARPOptions options = arp.getOptions();
ARPConfig.getOptions |
getEmbedding | public boolean getEmbedding()(Code) | | True if the embedding flag is set.
Indicates that the parser should look for rdf:RDF
element, rather than treat the whole file as an RDF/XML
document (possibly without rdf:RDF element).
|
setDefaultErrorMode | public void setDefaultErrorMode()(Code) | | Resets error mode to the default values:
many errors are reported as warnings, and resulting triples are produced.
|
setEmbedding | public boolean setEmbedding(boolean embed)(Code) | | 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). Previous setting. |
setErrorMode | public int setErrorMode(int errno, int mode)(Code) | | 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.
Most conditions are associated with one or more specific resources or literals
formed during the parse.
Triples involving resource or literal associated with an error condition
are not produced.
The precise definition of 'associated with' is deliberately
undefined, and may change in future releases.
This method can be used to downgrade an error condition to
a warning, or to upgrade a warning to an error.
Such a change modifies which triples are produced.
When the condition is a violation of the RDF/XML Syntax (Revised) Recommendations,
and the error mode is
ARPErrorNumbers.EM_IGNORE or
ARPErrorNumbers.EM_WARNING ,
the precise rules which ARP uses to generate triples for such ill-formed input are
not defined by any standard and are subject to change with future releases.
For input involving no errors, ARP creates triples in accordance with
the RDF/XML Syntax Revised Recommendation.
The mode can have one of the following four values.
-
ARPErrorNumbers.EM_IGNORE
- Ignore this condition. Produce triples.
-
ARPErrorNumbers.EM_WARNING
- Invoke ErrorHandler.warning() for this condition. Produce triples.
-
ARPErrorNumbers.EM_ERROR
- Invoke ErrorHandler.error() for this condition. Do not produce triples.
-
ARPErrorNumbers.EM_FATAL
- Aborts parse and invokes ErrorHandler.fatalError() for this condition.
Do not produce triples.
In unusual situations, a few further warnings and errors may be reported.
Parameters: errno - The specific error condition to change. Parameters: mode - The new mode for this condition. The old error mode for this condition. |
setLaxErrorMode | public void setLaxErrorMode()(Code) | | As many errors as possible are ignored.
As many triples as possible are produced.
|
setStrictErrorMode | public void setStrictErrorMode()(Code) | | This sets strict conformance to the W3C Recommendations.
|
setStrictErrorMode | public void setStrictErrorMode(int nonErrorMode)(Code) | | This method detects and prohibits errors according to
the W3C Recommendations.
For other conditions, such as
ARPErrorNumbers.WARN_PROCESSING_INSTRUCTION_IN_RDF , nonErrorMode is used.
Parameters: nonErrorMode - The way of treating non-error conditions. |
|
|