stella.xml
Class XMLRenderer

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.AbstractCommandRenderer
                  extended by stella.xml.XMLRenderer
All Implemented Interfaces:
Cloneable, ClusterDepending, CommandRendering, TargetDepending, DTDConstants, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class XMLRenderer
extends AbstractCommandRenderer
implements DTDConstants, TargetDepending

The interlink between the MasterMind and the Sequencing instance. Command templates from the Sequencer are completed by passing the command template, which matches the command type, and an additional template id string to the completion method of this renderer. In an XML-renderer this id must translate to a target-element id (so, it must be an IDREF). The appropriate element is passed to the command after the construction phase. This complete command class holds an updated version of the target-definition DOM, see DOMTarget to fullfill this request.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static String LAST
          ID-references starting with this string are refences to last commands.
private  Map recent
          A look-up table holding command templates to references.
private  ParameterClustering set
          The parameter cluster.
private  TargetDefinition target
          The target definition as a DOM object.
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface stella.xml.DTDConstants
ABORT, ABOVE, ABSTRACT, ABSTRACTPROPOSAL, ADDRESS, BELOW, BLOCK, BROADCAST, BROADCASTWITH, BV, 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
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
XMLRenderer(Map prop)
          Constructs a new complete command object with the given properties.
 
Method Summary
 CommandEvent getFullCommand(String template, String id, String parameter, String init, Map<String,Object> loop)
          Returns a fully qualified command event from a template.
 ParameterClustering getParameterCluster()
          Returns the parameter cluster registered at the renderer.
 TargetDefinition getTarget()
          Returns the target as a target dom.
 void registerCluster(ParameterClustering cluster)
          Registers the parameter cluster to this renderer.
 void registerTarget(TargetDefinition dom)
          Uses a parsed target-definition DOM and constructs a new complete command out of it.
 
Methods inherited from class stella.AbstractCommandRenderer
createCommandRenderer
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.Initializable
init
 

Field Detail

LAST

public static final String LAST
ID-references starting with this string are refences to last commands.

See Also:
Constant Field Values

target

private TargetDefinition target
The target definition as a DOM object.


set

private ParameterClustering set
The parameter cluster.


recent

private Map recent
A look-up table holding command templates to references.

Constructor Detail

XMLRenderer

public XMLRenderer(Map prop)
Constructs a new complete command object with the given properties.

Method Detail

registerTarget

public void registerTarget(TargetDefinition dom)
Uses a parsed target-definition DOM and constructs a new complete command out of it.

Specified by:
registerTarget in interface TargetDepending

getTarget

public TargetDefinition getTarget()
Returns the target as a target dom. Intended for subclasses.

Specified by:
getTarget in interface CommandRendering

registerCluster

public void registerCluster(ParameterClustering cluster)
Registers the parameter cluster to this renderer.

Specified by:
registerCluster in interface ClusterDepending

getParameterCluster

public ParameterClustering getParameterCluster()
Returns the parameter cluster registered at the renderer.

Specified by:
getParameterCluster in interface CommandRendering

getFullCommand

public CommandEvent getFullCommand(String template,
                                   String id,
                                   String parameter,
                                   String init,
                                   Map<String,Object> loop)
Returns a fully qualified command event from a template. This method uses the generic CommandEvent.createCommand(stella.MessageBin) to create a command event from the template string. If the second string is not equal null the renderer's target definition is scanned for the unique map which carries an ID attribute of the given value. Provided that the command event created is a TargetDependingCommand, this unique map is than registered at the command. ParameterDepending commands are treated similaily in that the renderer's parameter set is queried for the parameter of the given name which is then registered at the command. It is the command's responsibility to adjust its validity according to the target map or parameter registered to it. Note that parameter registering will always occur prior to target registering.

If the generation of the command somehow failes an illegal-argument exception is thrown.

For sequencing files that are changed at run-time, like for error- handling purposes, a special id LAST may be given. In this case, the last command reference that was used with that command, or the command specified after LAST refence is used.

If a command has multiple dependency, the sequence in which they are resolved starts with InitializerDepending, followed by ParameterDepending, then TargetDepending and finally TargetDependingCommand.

Specified by:
getFullCommand in interface CommandRendering
Parameters:
parameter - A comma-separated list of parameter to the command
loop - Paramters from the sequncer (counters etc.)
template - The command template, equal the command type.
id - An id further specializing the command template.
init - A static initializer to the command or null.