com.mkdoc.sax
Class UKIarReader

java.lang.Object
  |
  +--com.mkdoc.sax.AbstractXMLReader
        |
        +--com.mkdoc.sax.UKIarReader
All Implemented Interfaces:
org.xml.sax.XMLReader

public class UKIarReader
extends AbstractXMLReader
implements org.xml.sax.XMLReader

An XML parser for UK IAR records, emulates XHTML meta element SAX events.

XHTML emulation is designed to work directly with existing MetaTripleWriter and MetaStoreWriter content handlers and JSpider plugins.

Version:
0.1 2005-12-05
Author:
Philip Shaw

Nested Class Summary
 
Nested classes inherited from class com.mkdoc.sax.AbstractXMLReader
AbstractXMLReader.Feature, AbstractXMLReader.Property
 
Field Summary
 
Fields inherited from class com.mkdoc.sax.AbstractXMLReader
contHandler, dtdHandler, errorHandler, features, NAMESPACES, PREFIXES, properties, resolver
 
Constructor Summary
UKIarReader()
           
 
Method Summary
protected  java.lang.String getContent(java.lang.StringBuffer buffer)
          Get the IAR field content from a string buffer.
protected  java.lang.String getIdentifier(java.lang.StringBuffer buffer)
          Get the IAR field identifier from a string buffer.
 void parse(org.xml.sax.InputSource input)
          Parse input from an input source.
 void parseDocument(java.io.BufferedReader reader)
          Parse the IAR document line by line.
 boolean startsWithIdentifier(java.lang.String line)
          Check whether a line starts with a field identifier.
 
Methods inherited from class com.mkdoc.sax.AbstractXMLReader
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.XMLReader
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty
 

Constructor Detail

UKIarReader

public UKIarReader()
Method Detail

parse

public final void parse(org.xml.sax.InputSource input)
                 throws java.io.IOException,
                        org.xml.sax.SAXException
Parse input from an input source.

Specified by:
parse in interface org.xml.sax.XMLReader
Parameters:
input - A reference to the source document.
Throws:
java.io.IOException - If there is a problem reading the input source.
org.xml.sax.SAXException - If an error occurs parsing the input.
Since:
Version 0.1 2005-12-05

parseDocument

public final void parseDocument(java.io.BufferedReader reader)
                         throws java.io.IOException,
                                org.xml.sax.SAXException
Parse the IAR document line by line.

Parameters:
reader - A buffered reader reference to the source document.
Throws:
java.io.IOException - If there is a problem reading the input.
org.xml.sax.SAXException - If there is a problem parsing the input.
Since:
Version 0.1 2005-12-05

startsWithIdentifier

public final boolean startsWithIdentifier(java.lang.String line)
Check whether a line starts with a field identifier.

Parameters:
line - The line to check.
Returns:
true if the line starts with an identifier.

getContent

protected final java.lang.String getContent(java.lang.StringBuffer buffer)
Get the IAR field content from a string buffer.

Parameters:
buffer - The buffer from which to get the content.
Returns:
The field content.
Since:
Version 0.1 2005-12-05

getIdentifier

protected final java.lang.String getIdentifier(java.lang.StringBuffer buffer)
Get the IAR field identifier from a string buffer.

Parameters:
buffer - The buffer from which to get the identifier.
Returns:
The identifier.
Since:
Version 0.1 2005-12-05