com.mkdoc.jspider
Class AbstractRdfPlugin

java.lang.Object
  |
  +--com.mkdoc.jspider.AbstractMKDocPlugin
        |
        +--com.mkdoc.jspider.AbstractRdfPlugin
All Implemented Interfaces:
net.javacoding.jspider.api.event.EventSink, net.javacoding.jspider.spi.Plugin
Direct Known Subclasses:
AbstractFileStoreManagerPlugin, AbstractStoreManagerPlugin, RdfStoreWriterPlugin

public abstract class AbstractRdfPlugin
extends AbstractMKDocPlugin
implements net.javacoding.jspider.spi.Plugin

A base class for plugins that process RDF statements.

Version:
0.7 2005-12-13
Author:
Philip Shaw

Field Summary
protected  ApplicationProfile profile
          A custom metadata application profile.
 
Fields inherited from class com.mkdoc.jspider.AbstractMKDocPlugin
log, VENDOR
 
Constructor Summary
AbstractRdfPlugin()
           
 
Method Summary
protected  void configureHandler(RdfContentHandler handler)
          Configure an RDF handler with a custom application profile.
protected  org.xml.sax.InputSource getInputSource(java.io.InputStream inStream)
          Get an XML input source from an input stream.
protected  org.xml.sax.XMLReader getXmlReader()
          Get an XML reader for a parse.
protected  java.lang.String loadApplicationProfile(ApplicationContext context)
          Load a custom application profile if specified in a property set.
 void notify(net.javacoding.jspider.api.event.JSpiderEvent event)
          Receive notification of a JSpider event.
protected abstract  void parse(java.io.InputStream inStream, java.net.URL url)
          Add a resource to the repository from an input stream.
 void setXhtmlTidy(boolean setting)
          Set XHTML tidying.
 void setXmlReader(org.xml.sax.XMLReader xmlReader)
          Set a custom XML reader for a parse.
 
Methods inherited from class com.mkdoc.jspider.AbstractMKDocPlugin
getApplicationContext, getVendor, initialize, setLog, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.javacoding.jspider.spi.Plugin
getDescription, getName, getVendor, getVersion
 
Methods inherited from interface net.javacoding.jspider.api.event.EventSink
initialize, shutdown
 

Field Detail

profile

protected ApplicationProfile profile
A custom metadata application profile.

Since:
Version 0.1 2005-03-15
Constructor Detail

AbstractRdfPlugin

public AbstractRdfPlugin()
Method Detail

notify

public final void notify(net.javacoding.jspider.api.event.JSpiderEvent event)
Receive notification of a JSpider event.

Specified by:
notify in interface net.javacoding.jspider.api.event.EventSink
Parameters:
event - A JSpider event.
Since:
Version 0.2 2005-04-27

parse

protected abstract void parse(java.io.InputStream inStream,
                              java.net.URL url)
Add a resource to the repository from an input stream.

Parameters:
inStream - The input stream source for the metadata.
url - The URL of the source document.
Since:
Version 0.2 2005-04-27

loadApplicationProfile

protected final java.lang.String loadApplicationProfile(ApplicationContext context)
                                                 throws java.lang.ClassNotFoundException,
                                                        java.lang.InstantiationException,
                                                        java.lang.IllegalAccessException
Load a custom application profile if specified in a property set.

Parameters:
context - The application context for the plugin, which may contain a custom ApplicationProfile class name.
Returns:
A status message for logging.
Throws:
java.lang.ClassNotFoundException - If the custom profile cannot be located or instantiated.
java.lang.IllegalAccessException - If the classloader is not permitted to access the custom profile.
java.lang.InstantiationException - If the custom profile cannot be instantiated.
Since:
Version 0.4 2005-05-26

configureHandler

protected final void configureHandler(RdfContentHandler handler)
Configure an RDF handler with a custom application profile.

Parameters:
handler - The handler to configure.
Since:
Version 0.4 2005-05-26

getInputSource

protected final org.xml.sax.InputSource getInputSource(java.io.InputStream inStream)
Get an XML input source from an input stream.

Parameters:
inStream - The input stream from which to create an input source.
Returns:
An XML input source. If tidying is requested, the XHTML source will have been passed through JTidy.

setXhtmlTidy

public final void setXhtmlTidy(boolean setting)
Set XHTML tidying.

Parameters:
setting - Whether to pass (XHTML) source through JTidy.
Since:
Version 0.7 2005-12-13

getXmlReader

protected final org.xml.sax.XMLReader getXmlReader()
                                            throws org.xml.sax.SAXException
Get an XML reader for a parse.

Returns:
An XMLReader for the parse. If no custom reader has been assigned, the JAXP default reader will be used.
Throws:
org.xml.sax.SAXException - If the XML reader cannot be instantiated.
Since:
Version 0.7 2005-12-13

setXmlReader

public final void setXmlReader(org.xml.sax.XMLReader xmlReader)
Set a custom XML reader for a parse.

Parameters:
xmlReader - The custom XML reader to be used.
Since:
Version 0.1 2005-12-13