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, warningpublic 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 ContentHandlerstartDocument in class DefaultHandlerpublic void endDocument()
endDocument in interface ContentHandlerendDocument in class DefaultHandlerpublic void startElement(String uri, String localName, String qName, Attributes atts)
startElement in interface ContentHandlerstartElement in class DefaultHandlerpublic void endElement(String uri, String localName, String qName)
endElement in interface ContentHandlerendElement in class DefaultHandlerpublic void characters(char[] ch,
int start,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlerpublic void ignorableWhitespace(char[] ch,
int start,
int length)
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class DefaultHandlerpublic void startPrefixMapping(String prefix, String uri)
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerpublic void endPrefixMapping(String prefix)
endPrefixMapping in interface ContentHandlerendPrefixMapping in class DefaultHandlerpublic void processingInstruction(String target, String data)
processingInstruction in interface ContentHandlerprocessingInstruction in class DefaultHandlerpublic void skippedEntity(String name)
skippedEntity in interface ContentHandlerskippedEntity in class DefaultHandlerpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandlerpublic static SchemaMeta[] readTableSet(URL url, ContentCoding coding) throws IOException, SAXException
url - containing a TableSet document or similarcoding - configures HTTP content-codingIOExceptionSAXExceptionpublic static TableMeta[] readTables(URL url, ContentCoding coding) throws IOException, SAXException
<schema> element.url - containing a TableSet document or similarcoding - configures HTTP content-codingIOExceptionSAXExceptionpublic static TableSetSaxHandler populateHandler(URL url, ContentCoding coding) throws IOException, SAXException
url - containing a TableSet document or similarcoding - configures HTTP content-codingIOExceptionSAXExceptionpublic static void main(String[] args) throws IOException, SAXException
args - first element is a URL to read fromIOExceptionSAXExceptionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.