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

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

public class ARPHandlers
extends Object
implements Cloneable

Used for configuring user code to respond to statements and other events detected in input file.

Author:
Jeremy J. Carroll

Constructor Summary
ARPHandlers()
           
 
Method Summary
 ErrorHandler setErrorHandler(ErrorHandler eh)
          Sets the error handler, for both XML and RDF parse errors.
 ExtendedHandler setExtendedHandler(ExtendedHandler sh)
          Sets the ExtendedHandler that provides the callback mechanism for bnodes as they leave scope, and for the start and end of rdf:RDF elements.
 NamespaceHandler setNamespaceHandler(NamespaceHandler sh)
          Sets the NamespaceHandler that provides the callback mechanism for XML namespace declarations.
 StatementHandler setStatementHandler(StatementHandler sh)
          Sets the StatementHandler that provides the callback mechanism for each triple in the file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARPHandlers

public ARPHandlers()
Method Detail

setExtendedHandler

public ExtendedHandler setExtendedHandler(ExtendedHandler sh)
Sets the ExtendedHandler that provides the callback mechanism for bnodes as they leave scope, and for the start and end of rdf:RDF elements.

See note about large files in class documentation.

Parameters:
sh - The handler to use.
Returns:
The old handler.

setNamespaceHandler

public NamespaceHandler setNamespaceHandler(NamespaceHandler sh)
Sets the NamespaceHandler that provides the callback mechanism for XML namespace declarations.

Parameters:
sh - The handler to use.
Returns:
The old handler.

setStatementHandler

public StatementHandler setStatementHandler(StatementHandler sh)
Sets the StatementHandler that provides the callback mechanism for each triple in the file.

Parameters:
sh - The statement handler to use.
Returns:
The old statement handler.

setErrorHandler

public ErrorHandler setErrorHandler(ErrorHandler eh)
Sets the error handler, for both XML and RDF parse errors. XML errors are reported by Xerces, as instances of SAXParseException; the RDF errors are reported from ARP as instances of ParseException. Code that needs to distingusih between them may look like:
   void error( SAXParseException e ) throws SAXException {
     if ( e instanceof com.hp.hpl.jena.rdf.arp.ParseException ) {
          ...
     } else {
          ...
     }
   }
 

See the ARP documentation for ErrorHandler for details of the ErrorHandler semantics (in particular how to upgrade a warning to an error, and an error to a fatalError).

The Xerces/SAX documentation for ErrorHandler is available on the web.

Parameters:
eh - The error handler to use.
Returns:
The previous error handler.


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