public class DOMTools extends Object implements DTDConstants
DOMTargets.DOMHelper| Modifier and Type | Field and Description |
|---|---|
static String |
PREFIX_DEF
The key-header to the default position elements.
|
ABORT, ABOVE, ABSTRACT, ABSTRACTPROPOSAL, ADDRESS, BELOW, BLOCK, BROADCAST, BROADCASTWITH, BV, CHAINING, CHANGE, CLASS, COMMAND, COMMANDID, COMMANDINIT, COMMANDLAST, COMMANDPARAMETER, COMMANDREF, COMMENT, COMPLETE, CONDITION, CONSTANT, CONSTANTNAME, CONSTANTVALUE, CONSTRAINT, CONSTRAINTOVERDUE, CONSTRAINTRELAX, DATA, DAUGHTER, DEC, DELAY, DELAYMAX, DELAYTIME, DISABLED, DOCPATH, DURATION, ELAPSED, EMAIL, ENABLED, EPOCH, EQUINOX, EXCEPTION, EXCEPTIONDAUGHTER, EXCEPTIONFOR, EXCEPTIONSUCCESSOR, EXCEPTIONTHIS, FALSE, FIELDOFVIEW, FILE, FITSHEADER, FITSHEADERID, FORMATCLASS, FORMATPATTERN, FROM, GAIN, HISTORY, HISTORYCOMPLETE, HISTORYDB, HISTORYMAX, HISTORYREAD, IGNORE, IMAGETYPE, INIT, INSTITUTION, INSTRUMENT, INTERN, KEY, MAX, MERIT, MIN, NOTIFY, OBJECT, OBJECTID, OBJECTNAME, OBSERVSTART, PICK, PICKMERIT, PICKSUCCESS, PMDEC, PMRA, POSITION, RA, RATE, REC, REQUIRES, RETRY, RETRYMAX, SELECT, SENDING, SEQUENCE, SEQUENCETYPE, SET, SETNAME, SETUP, SETUPID, STEP, STEPCOUNTER, STEPWHILE, SUCCESSOR, TARGET, TARGETACCESS, TARGETDB, TARGETNAME, TARGETNAMEPROPOSAL, TARGETREAD, TARGETSUBMITTED, TARGETTYPE, TASK, TASKDONE, TASKID, TEAM, TIMESLOT, TITLE, TO, TRUE, USER, V, VARIABLE| Constructor and Description |
|---|
DOMTools() |
| Modifier and Type | Method and Description |
|---|---|
static Element |
addClassAttribute(Element to,
Object instance)
Adds an attribute stating the class name to the given element.
|
static Element |
addConstantToElement(Element src,
Map<String,Object> constant)
Appends several constants sections as child nodes to the target element.
|
static List<Meriting> |
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,
Star 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<Element> |
getConstantFromTable(Document builder,
Map<String,Object> 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 Star |
getStarFromElement(String name,
Element star)
Converts a position or field of view star sub section into a
SimpleStar object. |
static Map<String,Object> |
getTableFromConstant(Element constant)
Converts
DTDConstants.CONSTANT sub-nodes of the given element into a mapping
of names to values. |
static Element |
insert(Star entry,
Element container,
Node anchor,
Map<String,String> prop)
Appends astrometrical star data to the given element.
|
public static final String PREFIX_DEF
public static final Map<String,Object> 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<Element> getConstantFromTable(Document builder, Map<String,Object> 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<String,Object> constant)
getConstantFromTable(org.w3c.dom.Document, java.util.Map<java.lang.String, java.lang.Object>), 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 Star getStarFromElement(String name, Element star)
SimpleStar 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(Star entry, Element container, Node anchor, Map<String,String> prop)
SimpleStar 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 SimpleStar 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<Meriting> createMerit(NodeList nl)
public static final Element fillMerit(Element src, Meriting merit)
DTDConstants.GAIN or DTDConstants.TIMESLOT