|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcds.xml.XmlGen
cds.xml.VOTable
VOTable class is an extension of XmlGen class. It generates a XML file
according to the VOTable DTD. Methods here are application (VOTable)
oriented.
For all methods wich add attributes or tags, no test is made to check
if the addition is valid. It is the responsability of the developper
to ensure this, according to the VOTable DTD or Xschema.
Most of the methods return the VOTable object itself, allowing thus
'concatenation' of calls:
votable.addNameAttr("myname").addDescription("descr_text")...
The method nomenclature tries to respect the following rules:
addTag() is used when the method completely deals with a given tag
openTag()...endTag() are used when two methods() are needed to open
and close the tag.
addNameAttr(String val) is used for adding an attribute to the current tag
This class doesn't yet reflect the whole VOTable standard. First of all, because it is not yet stable, secondly because only the methods needed by SIMBAD are implemented...
Field Summary | |
private static java.lang.String |
dtdName
|
private static java.lang.String |
mainTag
|
private static java.lang.String |
TAG_CELL
|
private static java.lang.String |
TAG_ROW
|
private static java.lang.String |
version
|
private static Parameters |
votParms
|
private static java.lang.String |
xmlns
|
Fields inherited from class cds.xml.XmlGen |
|
Constructor Summary | |
VOTable(java.io.OutputStream os)
Creates a VOTable object The XML introduction tags are written |
|
VOTable(java.io.OutputStream os,
java.lang.String id)
Creates a VOTable object with an ID in the main tag The XML introduction tags are written |
Method Summary | |
VOTable |
addCell(java.lang.String data)
Adds a cell (TD tag) to a row |
VOTable |
addCell(java.lang.String data,
java.lang.String ref)
Adds a cell (TD tag) to a row |
VOTable |
addCoosys(java.lang.String sys,
java.lang.String eq,
java.lang.String ep)
Adds a COOSYS tag. |
VOTable |
addCoosys(java.lang.String id,
java.lang.String sys,
java.lang.String eq,
java.lang.String ep)
Adds a COOSYS tag. |
VOTable |
addDescription(java.lang.String text)
Adds a DESCRIPTION tag to the current entry |
VOTable |
addField(VotField fld)
Adds a field tag. |
VOTable |
addFieldList(java.util.ArrayList fields)
adds a field list (an ArrayList) |
VOTable |
addLink(java.lang.String link)
Add a LINK Tag To be developped |
VOTable |
addNameAttr(java.lang.String name)
Adds a name (attribute) to the current entry |
VOTable |
addParam()
Add a PARAM tag. |
VOTable |
addRefAttr(java.lang.String ref)
Adds a reference (attribute) to the current entry |
VOTable |
closeCell()
Closes the current cell (TD tag) |
VOTable |
closeDefinitions()
Closes a DEFINITIONS tag |
VOTable |
closeResource()
Closes the most recently opened RESOURCE tag If other tags inside the RESOURCE tag are still opened, they will be automatically closed. |
VOTable |
closeRow()
Closes a row (TR tag). |
VOTable |
closeTable()
Closes a TABLE tag |
VOTable |
closeTabledata()
Closes a TABLEDATA tag Includes the closingof the DATA tag |
VOTable |
nextRow()
Closes a row (TR tag) and opens the next one. |
private void |
open(java.lang.String id)
|
VOTable |
openCell()
Opens a cell(TD tag) |
VOTable |
openDefinitons()
Opens a DEFINITIONS tag (needed to embed COOSYS and PARAM tags) |
VOTable |
openResource()
Opens a RESOURCE tag. |
VOTable |
openResource(java.lang.String name)
Opens a RESOURCE tag. |
VOTable |
openRow()
Opens a row (TR tag). |
VOTable |
openTable()
Opens a TABLE tag. |
VOTable |
openTable(java.lang.String name)
Opens a TABLE tag. |
VOTable |
openTabledata()
Opens a TABLEDATA tag Includes the opening of the DATA tag |
Methods inherited from class cds.xml.XmlGen |
addAttr, addAttr, addID, addText, addText, close, closeAllTags, closeTag, closeTag, doctype, flush, getCurrentTagName, indent, openTag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Parameters votParms
private static java.lang.String dtdName
private static java.lang.String xmlns
private static final java.lang.String version
private static final java.lang.String mainTag
private static final java.lang.String TAG_ROW
private static final java.lang.String TAG_CELL
Constructor Detail |
public VOTable(java.io.OutputStream os, java.lang.String id)
os
- OutputStream where the VOTable will be writtenid
- XML identifierpublic VOTable(java.io.OutputStream os)
os
- OutputStream where the VOTable will be writtenMethod Detail |
private void open(java.lang.String id)
public VOTable addNameAttr(java.lang.String name)
name
- name to be added as a 'name' attribute
public VOTable addRefAttr(java.lang.String ref)
ref
- reference to be added as a 'ref' attribute
public VOTable addDescription(java.lang.String text)
text
- Description text
public VOTable openDefinitons()
public VOTable closeDefinitions()
public VOTable addCoosys(java.lang.String sys, java.lang.String eq, java.lang.String ep)
sys
- Coordinate system (eq_FK4, eq_FK5, ICRS, ecl_FK4, ecl_FK5, galactic, supergalactic, xy, barycentric, geo_app)
or nulleq
- Equinoxe (or null)ep
- Epoch (or null)
public VOTable addCoosys(java.lang.String id, java.lang.String sys, java.lang.String eq, java.lang.String ep)
id
- Tag identifiersys
- Coordinate system (eq_FK4, eq_FK5, ICRS, ecl_FK4, ecl_FK5, galactic, supergalactic, xy, barycentric, geo_app)
or nulleq
- Equinoxe (or null)ep
- Epoch (or null)
addParam()
public VOTable addParam()
public VOTable addLink(java.lang.String link)
link
- link to be added
public VOTable openResource()
closeResource()
public VOTable openResource(java.lang.String name)
name
- name attribute to add
closeResource()
public VOTable closeResource()
public VOTable openTable()
closeTable()
public VOTable openTable(java.lang.String name)
name
- name attribute for the TABLE tag
closeTable()
public VOTable closeTable()
public VOTable addField(VotField fld)
fld
- VotField object to use to build the FIELD tag with all its
attributes and inner elements
public VOTable addFieldList(java.util.ArrayList fields)
fields
- an ArrayList of VotField objects
public VOTable openTabledata()
public VOTable closeTabledata()
public VOTable openRow()
public VOTable nextRow()
public VOTable closeRow()
public VOTable addCell(java.lang.String data)
data
- string containing the data of the cell.
public VOTable addCell(java.lang.String data, java.lang.String ref)
data
- string containing the data of the cell.ref
- Reference attribute to associate with this cell
public VOTable openCell()
public VOTable closeCell()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |