Class ARPOptions

All Implemented Interfaces:

public class ARPOptions extends Object implements ARPErrorNumbers
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 compatibility 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.
  • Method Details

    • createNewOptions

      public static ARPOptions createNewOptions()
      Internal use only
    • 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. 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.

      Ignore this condition. Produce triples.
      Invoke ErrorHandler.warning() for this condition. Produce triples.
      Invoke ErrorHandler.error() for this condition. Do not produce triples.
      Aborts parse and invokes ErrorHandler.errorError() for this condition. Do not produce triples. In unusual situations, a few further warnings and errors may be reported.
      errno - The specific error condition to change.
      mode - The new mode for this condition.
      The old error mode for this condition.
    • setDefaultErrorMode

      public void setDefaultErrorMode()
      Resets error mode to the default values: many errors are reported as warnings, and resulting 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 sets strict conformance to the W3C Recommendations.
    • setStrictErrorMode

      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.
      nonErrorMode - The way of treating non-error conditions.
    • copy

      public ARPOptions copy()
      Internal use only. Copies this object.
      A copy.
    • 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).
      embed - true: Look for embedded RDF; or false: match a typed node or rdf:Description against the whole document (the default).
      Previous setting.
    • getErrorMode

      public int getErrorMode(int eCode)
      Returns the error mode for the given error code.
      eCode -
      One of ARPErrorNumbers.EM_IGNORE, ARPErrorNumbers.EM_WARNING, ARPErrorNumbers.EM_ERROR, ARPErrorNumbers.EM_FATAL
    • getEmbedding

      public boolean getEmbedding()
      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).
    • setIRIProvider

      public void setIRIProvider(IRIProvider f)
      Set the IRI factory (and hence the IRI checking rules)
    • getIRIProvider

      public IRIProvider getIRIProvider()
      Get the IRI factory (and hence the IRI checking rules)