|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.edustructures.sifworks.tools.mapping.ObjectMapAdaptor
com.edustructures.sifworks.tools.mapping.StringMapAdaptor
public class StringMapAdaptor
A FieldAdaptor implementation that contains field values to assign to the supplied SIFDataObject, where each entry in the map is keyed by the local application-defined name of a field and the value is the text value to assign to the corresponding element or attribute of the SIFDataObject, in the SIF 1.5r1 text format.
This class is most useful for agents that were written using the 1.x version of the ADK and offers compatibility with the Mappings implementation used in that release. Values mapped to and from the Map used in this class will match the textual representation of those values in the 1.x version of the ADK. For example, a SIF date field that is mapped to this class will map to and from the SIF 1.5 format for dates, which was yyyyMMdd.
The Data-to-Text formatting is controlled by the ADK.getTextFormatter()
property, which defaults to SIF 1.5 formatting. If you wish to supply your own text formatter,
you can call the constructor overload that accepts a SIFFormatter instance.
To use this class,
ObjectMapAdaptor.setOverwriteValues(boolean)
property is set to True.
Mappings
class,by calling the appropriate map method and passing the SIFDataObject
instance to retrieve field values from for insertion into the
Map. The method first looks up the ObjectMapping instance
corresponding to the SIF Data Object type. If no ObjectMapping
has been defined for the object type, no action is taken and the
method returns successfully without exception. Otherwise, all
field rules defined by the ObjectMapping are evaluated in order.
If a rule evaluates successfully, the corresponding element or
attribute value will be inserted into the HashMap. A rule will
not be evaluated if the associated field already exists in the
Map, unless the
ObjectMapAdaptor.setOverwriteValues(boolean)
property is set to True.
ADK.setTextFormatter(SIFFormatter),
ADK.getTextFormatter(),
Mappings| Constructor Summary | |
|---|---|
StringMapAdaptor(java.util.Map dataMap)
Creates an instance of StringMapAdaptor that uses the specified Map |
|
StringMapAdaptor(java.util.Map dataMap,
SIFFormatter formatter)
Creates an instance of StringMapAdaptor that uses the specified map and specified SIFFormatter instance for deriving String values from SIF datatypes |
|
| Method Summary |
|---|
| Methods inherited from class com.edustructures.sifworks.tools.mapping.ObjectMapAdaptor |
|---|
declareVariable, getMap, getOverwriteValues, getSIFValue, getValue, getVariable, hasField, isDeclaredVariable, keySet, setMap, setOverwriteValues, setSIFValue, undeclareVariable |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringMapAdaptor(java.util.Map dataMap)
dataMap - The Map to use for SIF Data mapping operations
public StringMapAdaptor(java.util.Map dataMap,
SIFFormatter formatter)
dataMap - The Map to use for SIF Data mapping operationsformatter - The formatter to use for converting SIF native datatypes to
text and back again.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||