|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectstella.xml.DOMTools
public class DOMTools
A helper class consisting only of static methods that are used to convert
DOM Nodes to java classes. Provides also very specific methods
only useful for DOMTargets.
DOMHelper| Field Summary | |
|---|---|
static String |
KEY_DEF
The key-header to the default position elements. |
| Constructor Summary | |
|---|---|
DOMTools()
|
|
| Method Summary | |
|---|---|
static Element |
addClassAttribute(Element to,
Object instance)
Adds an attribute stating the class name to the given element. |
static Element |
addConstantToElement(Element src,
Map constant)
Appends several constants sections as child nodes to the target element. |
static List |
createMerit(NodeList nl)
Scans a node-list of merits into actual living merit references. |
static Element |
fillMerit(Element src,
Meriting merit)
Fills a merit definition in the element. |
static Element |
fillPosition(Element src,
StarDescription star)
Adds position data from a {link @StarDescription} into the container element provided. |
static Class |
getClassFromElement(Element check)
Returns the class specified as a DTDConstants.CLASS attribute to an element. |
static List |
getConstantFromTable(Document builder,
Map con)
Converts the content of a map into a list of elements constituted of DTDConstants.CONSTANT elements, where
the keys are specified with DTDConstants.CONSTANTNAME and the values with
DTDConstants.CONSTANTVALUE. |
static Object |
getInstanceFromElement(Element cls,
String init)
Returns a new instance of a class specified as a DTDConstants.CLASS
attribute to an element. |
static StarDescription |
getStarFromElement(Element star)
Converts a position or field of view star sub section into a StarDescription object. |
static Map |
getTableFromConstant(Element constant)
Converts DTDConstants.CONSTANT sub-nodes of the given element into a
mapping of names to values. |
static Element |
insert(StarDescription entry,
Element container,
Node anchor,
Map prop)
Appends astrometrical star data to the given element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String KEY_DEF
| Constructor Detail |
|---|
public DOMTools()
| Method Detail |
|---|
public static final Map getTableFromConstant(Element constant)
DTDConstants.CONSTANT sub-nodes of the given element into a
mapping of names to values.
If the DTDConstants.CLASS attribute is specified, the values found are
parsed into objects of that type.
public static final List getConstantFromTable(Document builder,
Map con)
DTDConstants.CONSTANT elements, where
the keys are specified with DTDConstants.CONSTANTNAME and the values with
DTDConstants.CONSTANTVALUE. The instant type of the value enters the
DTDConstants.CONSTANT section as a DTDConstants.CLASS attribute.
builder - The root document to create the required DOM-nodes.con - The name-to-value mapping to convert.
DTDConstants.CONSTANT elements.
public static final Element addConstantToElement(Element src,
Map constant)
getConstantFromTable(org.w3c.dom.Document, java.util.Map), then adds this element-by-element
as child to the target element.
public static final Class getClassFromElement(Element check)
DTDConstants.CLASS attribute to an element.
If no such attribute is given, null is returned.
public static final Object getInstanceFromElement(Element cls,
String init)
DTDConstants.CLASS
attribute to an element. The string passed as the initial value is
used in the constructor of the class to create the new instance.
cls - The element that carries the class attribute.init - The string used in initialization in the single-string
constructor.
public static final Element addClassAttribute(Element to,
Object instance)
public static StarDescription getStarFromElement(Element star)
StarDescription object. At least ra and dec must
be present. The name of the star is never set because it is not part
of a DTDConstants.POSITION element.
public static Element insert(StarDescription entry,
Element container,
Node anchor,
Map prop)
StarDescription type. The stated
DOM element must support theses fields in the stated sequence
as the childs immediately before the given anchor.:
DTDConstants.RA: Right ascension of the object.DTDConstants.DEC: Declination of the object.DTDConstants.EPOCH: Epoch of the position.DTDConstants.PMRA: Proper motion in ra.DTDConstants.PMDEC: Proper motion in dec.DTDConstants.V: Magnitude in Johnson V band.DTDConstants.BV: Color index Johnson B-V.
If the StarDescription argument is null this method
acts
like a test for completeness of the required elements.
entry - The tycho-database query result to be inserted.container - The element where the database results should be
insertedanchor - The child node before which the database results should be
inserted. If null, values are appended.
public static final List createMerit(NodeList nl)
public static final Element fillMerit(Element src,
Meriting merit)
DTDConstants.GAIN or DTDConstants.TIMESLOT
public static final Element fillPosition(Element src,
StarDescription star)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||