|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.HandlerBase
uk.ac.ic.doc.automed.xml.XMLReader
public class XMLReader
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface uk.ac.ic.doc.automed.xml.XMLifyConstants |
---|
XMLifyConstants.IgnoreNextElementException |
Field Summary | |
---|---|
private int |
bufferSize
|
private boolean |
debug
|
private static int |
defBufferSize
|
private java.util.LinkedList |
errors
|
private boolean |
finished
|
private org.xml.sax.Locator |
locator
|
private java.lang.Thread |
parserThread
|
private boolean |
separateErrors
|
private static javax.xml.parsers.SAXParserFactory |
spf
|
private java.util.Set |
supressedTokenTypes
|
private boolean |
supressIgnorableWhitespace
|
private boolean |
throwErrors
|
private java.util.LinkedList |
tokens
|
Constructor Summary | |
---|---|
XMLReader()
|
|
XMLReader(int bufferSize)
|
Method Summary | |
---|---|
void |
addSupressedTokenType(int type)
|
void |
addSupressedTokenTypes(int[] types)
|
private void |
addToken(int type,
java.lang.String name,
java.lang.Object datum)
|
void |
characters(char[] ch,
int start,
int length)
|
void |
close()
call this if you intend to stop reading tokens and haven't read an END_DOCUMENT or SAX_ERROR token this will not return until the parser thread completes or it times out at which point it throws an XMLReaderException. |
void |
close(int milliseconds)
|
void |
endDocument()
|
void |
endElement(java.lang.String name)
|
void |
error(org.xml.sax.SAXParseException exception)
|
void |
fatalError(org.xml.sax.SAXParseException exception)
|
int |
getBufferSize()
|
boolean |
getDebug()
|
private java.lang.String |
getLocation()
|
private java.lang.String |
getLocationPad()
|
boolean |
getSeparateErrors()
by default, errors are reported through the token stream, for parsing this may not be convenient you can have errors reported through getErrors() instead by setting separateErrors to true |
int[] |
getSupressedTokenTypes()
|
boolean |
getSupressIgnorableWhitespace()
The supressIgnorableWhitespace property and supressTokenTypes list are different in knid. |
boolean |
getThrowErrors()
all errors are reported through the token stream or through the error stream, by setting throwErrors you can have nextToken and peekToken throw an exception if the next token is an error. |
private java.lang.String |
getTokenList(int[] list)
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
boolean |
isNamespaceAware()
|
boolean |
isTokenTypeSupressed(int type)
|
boolean |
isValidating()
|
XMLToken |
nextError()
If separateErrors is set to true and nextToken() or peekToken() have (or would on next call) returned return null then getNextError will keep returning errors until the list is exhausted at which point it will return null otherwise it will just return null |
private XMLToken |
nextSingleToken()
|
XMLToken |
nextToken()
|
XMLToken |
nextToken(int type)
|
XMLToken |
nextToken(int[] types)
|
XMLToken |
nextToken(int[] types,
java.lang.String[] names)
|
XMLToken |
nextToken(int type,
java.lang.String name)
throws an XMLReaderException if the next element or its name is not of the expected type |
void |
notationDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
XMLToken |
peekError()
|
private XMLToken |
peekSingleToken()
|
XMLToken |
peekToken()
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
|
void |
removeSupressedTokenType(int type)
|
void |
removeSupressedTokenTypes(int[] types)
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
|
void |
setDebug(boolean b)
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
|
void |
setNamespaceAware(boolean b)
|
void |
setSeparateErrors(boolean b)
|
void |
setSupressedTokenTypes(int[] types)
|
void |
setSupressIgnorableWhitespace(boolean b)
|
void |
setThrowErrors(boolean b)
|
void |
setValidating(boolean b)
|
void |
skipTokens(int type)
|
void |
skipTokens(int[] types)
|
XMLToken |
skipToNextToken(int type)
|
XMLToken |
skipToNextToken(int[] types)
|
void |
start(org.xml.sax.InputSource is)
|
void |
start(java.lang.String filename)
|
void |
startDocument()
|
void |
startElement(java.lang.String name,
org.xml.sax.AttributeList atts)
|
void |
unparsedEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName)
|
void |
warning(org.xml.sax.SAXParseException exception)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static javax.xml.parsers.SAXParserFactory spf
private java.util.LinkedList tokens
private java.util.LinkedList errors
private boolean debug
private static int defBufferSize
private final int bufferSize
private org.xml.sax.Locator locator
private boolean finished
private java.lang.Thread parserThread
private boolean separateErrors
private boolean throwErrors
private boolean supressIgnorableWhitespace
private java.util.Set supressedTokenTypes
Constructor Detail |
---|
public XMLReader()
public XMLReader(int bufferSize)
Method Detail |
---|
public int getBufferSize()
public boolean getDebug()
public void setDebug(boolean b)
public boolean getSeparateErrors()
public void setSeparateErrors(boolean b)
public boolean getThrowErrors()
public void setThrowErrors(boolean b)
public boolean getSupressIgnorableWhitespace()
public void setSupressIgnorableWhitespace(boolean b)
public boolean isTokenTypeSupressed(int type)
public int[] getSupressedTokenTypes()
public void setSupressedTokenTypes(int[] types)
public void addSupressedTokenType(int type)
public void addSupressedTokenTypes(int[] types)
public void removeSupressedTokenType(int type)
public void removeSupressedTokenTypes(int[] types)
public boolean isNamespaceAware()
public void setNamespaceAware(boolean b)
public boolean isValidating()
public void setValidating(boolean b)
public void start(java.lang.String filename) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException, java.lang.IllegalArgumentException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
java.lang.IllegalArgumentException
public void start(org.xml.sax.InputSource is) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException, java.lang.IllegalArgumentException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
java.lang.IllegalArgumentException
public XMLToken nextError() throws java.lang.Exception
java.lang.Exception
public XMLToken peekError() throws java.lang.Exception
java.lang.Exception
public void skipTokens(int type) throws java.lang.Exception
java.lang.Exception
public void skipTokens(int[] types) throws java.lang.Exception
java.lang.Exception
public XMLToken skipToNextToken(int type) throws java.lang.Exception
java.lang.Exception
public XMLToken skipToNextToken(int[] types) throws java.lang.Exception
java.lang.Exception
public XMLToken nextToken(int type, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public XMLToken nextToken(int[] types, java.lang.String[] names) throws java.lang.Exception
java.lang.Exception
public XMLToken nextToken(int type) throws java.lang.Exception
java.lang.Exception
public XMLToken nextToken(int[] types) throws java.lang.Exception
java.lang.Exception
private java.lang.String getTokenList(int[] list)
public XMLToken nextToken() throws java.lang.Exception
java.lang.Exception
private XMLToken nextSingleToken() throws java.lang.Exception
java.lang.Exception
public XMLToken peekToken() throws java.lang.Exception
java.lang.Exception
private XMLToken peekSingleToken() throws java.lang.Exception
java.lang.Exception
public void close() throws XMLReaderException
XMLReaderException
public void close(int milliseconds) throws XMLReaderException
XMLReaderException
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
resolveEntity
in interface org.xml.sax.EntityResolver
resolveEntity
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
notationDecl
in interface org.xml.sax.DTDHandler
notationDecl
in class org.xml.sax.HandlerBase
public void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)
unparsedEntityDecl
in interface org.xml.sax.DTDHandler
unparsedEntityDecl
in class org.xml.sax.HandlerBase
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.DocumentHandler
setDocumentLocator
in class org.xml.sax.HandlerBase
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.DocumentHandler
startDocument
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.DocumentHandler
endDocument
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void startElement(java.lang.String name, org.xml.sax.AttributeList atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.DocumentHandler
startElement
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void endElement(java.lang.String name) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.DocumentHandler
endElement
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.DocumentHandler
characters
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.DocumentHandler
ignorableWhitespace
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.DocumentHandler
processingInstruction
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void warning(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.HandlerBase
org.xml.sax.SAXException
private void addToken(int type, java.lang.String name, java.lang.Object datum) throws org.xml.sax.SAXException
org.xml.sax.SAXException
private java.lang.String getLocation()
private java.lang.String getLocationPad()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |