public class TableSetSaxHandler extends DefaultHandler
The easiest way to make use of this class is via the static method
readTableSet(java.net.URL, uk.ac.starlink.util.ContentCoding)
or the convenience main(java.lang.String[])
method.
Constructor and Description |
---|
TableSetSaxHandler()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endDocument() |
void |
endElement(String uri,
String localName,
String qName) |
void |
endPrefixMapping(String prefix) |
TableMeta[] |
getNakedTables()
Returns the array of table metadata objects which were found
outside of any schema.
|
SchemaMeta[] |
getSchemas(boolean includeNaked)
Returns the array of schema metadata objects which have been
read by this parser.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
static void |
main(String[] args)
Main method to parse a tableset from the command line.
|
static TableSetSaxHandler |
populateHandler(URL url,
ContentCoding coding)
Uses an instance of this class to parse the document at a given URL.
|
void |
processingInstruction(String target,
String data) |
static TableMeta[] |
readTables(URL url,
ContentCoding coding)
Uses an instance of this class to read an XML document from a given
URL and extracts a flat list of all the TableMeta objects it
represents.
|
static SchemaMeta[] |
readTableSet(URL url,
ContentCoding coding)
Uses an instance of this class to read an XML document from a given
URL and extract the SchemaMeta objects it represents.
|
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String name) |
void |
startDocument() |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts) |
void |
startPrefixMapping(String prefix,
String uri) |
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning
public SchemaMeta[] getSchemas(boolean includeNaked)
includeNaked
- if false, only the schemas actually encountered
are returned; if true, then any naked tables
will be included in a dummy schema in the resultpublic TableMeta[] getNakedTables()
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 localName, String qName, Attributes atts)
startElement
in interface ContentHandler
startElement
in class DefaultHandler
public void endElement(String uri, String localName, String qName)
endElement
in interface ContentHandler
endElement
in class DefaultHandler
public void characters(char[] ch, int start, int length)
characters
in interface ContentHandler
characters
in class DefaultHandler
public void ignorableWhitespace(char[] ch, int start, int length)
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class DefaultHandler
public void startPrefixMapping(String prefix, String uri)
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class DefaultHandler
public void endPrefixMapping(String prefix)
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class DefaultHandler
public void processingInstruction(String target, String data)
processingInstruction
in interface ContentHandler
processingInstruction
in class DefaultHandler
public void skippedEntity(String name)
skippedEntity
in interface ContentHandler
skippedEntity
in class DefaultHandler
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
public static SchemaMeta[] readTableSet(URL url, ContentCoding coding) throws IOException, SAXException
url
- containing a TableSet document or similarcoding
- configures HTTP content-codingIOException
SAXException
public static TableMeta[] readTables(URL url, ContentCoding coding) throws IOException, SAXException
<schema>
element.url
- containing a TableSet document or similarcoding
- configures HTTP content-codingIOException
SAXException
public static TableSetSaxHandler populateHandler(URL url, ContentCoding coding) throws IOException, SAXException
url
- containing a TableSet document or similarcoding
- configures HTTP content-codingIOException
SAXException
public static void main(String[] args) throws IOException, SAXException
args
- first element is a URL to read fromIOException
SAXException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.