|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.votable.VOTableBuilder
public class VOTableBuilder
Implementation of the TableBuilder interface which gets StarTables from VOTable documents.
Constructor Summary | |
---|---|
VOTableBuilder()
Default constructor. |
|
VOTableBuilder(boolean strict)
Constructs a builder with explicit setting of whether VOTable standard interpreation is strict or not. |
Method Summary | |
---|---|
boolean |
canImport(java.awt.datatransfer.DataFlavor flavor)
Returns true for flavors which have MIME types starting text/xml application/xml application/x-votable+xml |
java.lang.String |
getFormatName()
Returns the string "votable". |
StarTable |
makeStarTable(DataSource datsrc,
boolean wantRandom,
StoragePolicy storagePolicy)
Makes a StarTable out of a DataSource which points to a VOTable. |
TableSequence |
makeStarTables(DataSource datsrc,
StoragePolicy storagePolicy)
Constructs a sequence of StarTables based on a given DataSource. |
void |
streamStarTable(java.io.InputStream istrm,
TableSink sink,
java.lang.String index)
Acquires the data from a single TABLE element in a VOTable document, writing the result to a sink. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VOTableBuilder()
VOElementFactory.isStrictByDefault()
.
public VOTableBuilder(boolean strict)
strict
- true iff you want strict enforcement of VOTable standardVOElementFactory.setStrict(boolean)
Method Detail |
---|
public java.lang.String getFormatName()
getFormatName
in interface TableBuilder
public StarTable makeStarTable(DataSource datsrc, boolean wantRandom, StoragePolicy storagePolicy) throws TableFormatException, java.io.IOException
makeStarTable
in interface TableBuilder
datsrc
- the location of the VOTable document to usewantRandom
- whether, preferentially, a random access table
should be returned (doesn't guarantee that it will be random)storagePolicy
- a StoragePolicy object which may be used to
supply scratch storage if the builder needs it
TableFormatException
- if the table is not of a kind that
can be handled by this handler
java.io.IOException
- if an unexpected I/O error occurs during processingpublic TableSequence makeStarTables(DataSource datsrc, StoragePolicy storagePolicy) throws TableFormatException, java.io.IOException
MultiTableBuilder
TableFormatException
should be thrown. If this builder thinks it should be able to
handle the source but an error occurs during processing, an
IOException
can be thrown.
If the position
of the data source is not null,
then this method should return a sequence containing a single table,
the one which would be returned by the makeStarTable
method with that position.
makeStarTables
in interface MultiTableBuilder
datsrc
- the DataSource containing the table resourcestoragePolicy
- a StoragePolicy object which may be used to
supply scratch storage if the builder needs it
datsrc
TableFormatException
- if the table is not of a kind that
can be handled by this handler
java.io.IOException
- if an unexpected I/O error occurs during processingpublic boolean canImport(java.awt.datatransfer.DataFlavor flavor)
canImport
in interface TableBuilder
flavor
- the DataFlavor whose suitability as stream input
is to be assessed
public void streamStarTable(java.io.InputStream istrm, TableSink sink, java.lang.String index) throws java.io.IOException
Note that only table metadata that precedes the TABLE element in the XML stream can be picked up when using this method. If there are any XML elements following the end of the TABLE whose content would normally show up in table metadata, it will be ignored when using this method.
For more flexible streamed access to VOTable data, use a
TableContentHandler
.
streamStarTable
in interface TableBuilder
istrm
- stream from which the VOTable document will be suppliedsink
- callback interface into which the table metadata and
data will be dumpedindex
- if present, a string representation of the index of
the table in the document to be read - "0" means the
first one encountered, "1" means the second, etc.
If it's null or not of numeric form the
first table will be used
TableFormatException
- if the table can't be streamed or
the data is malformed
java.io.IOException
- if some other error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |