|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
jwo.landserf.process.io.MasterMapReader
public class MasterMapReader
Reads in an Ordnance Survey MasterMap file in serial fashion using a SAX parser.
Constructor Summary | |
---|---|
MasterMapReader(String fileName,
GISFrame gisFrame,
LSThread lsThread)
Starts the parsing of the given XML file, and gathers information about the attribute types. |
|
MasterMapReader(String fileName,
VectorMap vectorMap,
GISFrame gisFrame,
LSThread lsThread)
Starts the parsing of the given XML file, placing all objects into the given vector map and reporting progress to the GISFrame. |
|
MasterMapReader(String fileName,
VectorMap vectorMap,
TreeMap attributeTypes,
int readStyle,
boolean storeObjectIDs,
GISFrame gisFrame,
LSThread lsThread)
Starts the parsing of the given XML file. |
Method Summary | |
---|---|
void |
characters(char[] text,
int offset,
int length)
Called by the parser when character text is found. |
protected void |
display(String message,
boolean position)
Displays the given message with an option of identifying the approximate currently parsed line and column identified by the parser Locator. |
void |
endDocument()
Called by the parser when the document represented by the XML is finally closed. |
void |
endElement(String uri,
String sName,
String qName)
Called by the parser when the end of an element is found. |
void |
error(SAXParseException e)
Called when the parser encounters a non-fatal error. |
void |
fatalError(SAXParseException e)
Called when the parser encounters a fatal error. |
TreeMap |
getAttributeTypes()
Reports a list of feature codes and descriptions found after scanning the XML file. |
String |
getLastError()
Reports last error that was generated by the parser, or null if no error or warning has occurred. |
void |
setDocumentLocator(Locator locator)
This method is called by the parser when the XML file for parsing is first opened. |
void |
startDocument()
Called by the parser when the document represented by the XML is first opened. |
void |
startElement(String uri,
String sName,
String qName,
Attributes atts)
Called by the parser when the start of an element is found. |
void |
warning(SAXParseException e)
Called when the parser encounters a non-fatal warning. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MasterMapReader(String fileName, VectorMap vectorMap, GISFrame gisFrame, LSThread lsThread)
fileName
- Name of XML file to process.vectorMap
- Vector map to contain XML data.gisFrame
- GIS Frame in which to report progress.lsThread
- Thread which called this method (allows it to be interrupted).
Can be null if no external interruption allowed.public MasterMapReader(String fileName, GISFrame gisFrame, LSThread lsThread)
fileName
- Name of XML file to process.gisFrame
- GIS Frame in which to report progress.lsThread
- Thread which called this method (allows it to be interrupted).
Can be null if no external interruption allowed.public MasterMapReader(String fileName, VectorMap vectorMap, TreeMap attributeTypes, int readStyle, boolean storeObjectIDs, GISFrame gisFrame, LSThread lsThread)
fileName
- Name of XML file to process.vectorMap
- Vector map to contain XML data.attributeTypes
- Ordered list of attribute feature codes to be read (only applied to LOAD_SELECTED).readStyle
- Determines how file is processed.storeObjectIDs
- If true, object IDs are stored as attributes.gisFrame
- GIS Frame in which to report progress.lsThread
- Thread which called this method (allows it to be interrupted).
Can be null if no external interruption allowed.Method Detail |
---|
public TreeMap getAttributeTypes()
public String getLastError()
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
locator
- Keeps track of the parsing process.public void startDocument()
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
public void endDocument()
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
public void startElement(String uri, String sName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
uri
- Namespace reference (ignored).sName
- Simple name of the element.qName
- Fully qualified name of the element.atts
- Attributes associated with the element.
SAXException
- if problem parsing XML file.public void endElement(String uri, String sName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
uri
- Namespace reference (ignored).sName
- Simple name of the element.qName
- Fully qualified name of the element.
SAXException
- if problem parsing end of element.public void characters(char[] text, int offset, int length)
characters
in interface ContentHandler
characters
in class DefaultHandler
text
- Array of characters.offset
- Position in array where characters start.length
- Number of characters to use from text array.public void warning(SAXParseException e)
warning
in interface ErrorHandler
warning
in class DefaultHandler
e
- Exception that caused the warning.public void error(SAXParseException e)
error
in interface ErrorHandler
error
in class DefaultHandler
e
- Exception that caused the warning.public void fatalError(SAXParseException e)
fatalError
in interface ErrorHandler
fatalError
in class DefaultHandler
e
- Exception that caused the warning.protected void display(String message, boolean position)
message
- Message to display.position
- Position in the file identified if true.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |