|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.edustructures.sifworks.tools.mapping.ObjectMapAdaptor
public class ObjectMapAdaptor
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 native Java datatype of the corresponding element or attribute of the SIFDataObject, such as a Calender, String, Integer, Boolean, etc.
To use this class,
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
setOverwriteValues(boolean)
property is set to True.
Mappings| Constructor Summary | |
|---|---|
ObjectMapAdaptor(java.util.Map map)
Creates an instance of ObjectMapAdaptor that uses the specified Map |
|
| Method Summary | |
|---|---|
void |
declareVariable(java.lang.String varName,
java.lang.Object value)
Declares a field for the JXPath variable and assigns the value |
java.util.Map |
getMap()
Gets the Map being used for SIF data mapping operations |
boolean |
getOverwriteValues()
Returns whether this class will overwrite existing values in the Map during inbound mapping operations of data coming from SIF. |
SIFSimpleType |
getSIFValue(java.lang.String fieldName,
SIFTypeConverter typeConverter,
FieldMapping mapping)
Gets a value from the underlying data store to be used in an outbound field mapping operation |
java.lang.Object |
getValue(java.lang.String fieldName)
Returns the underlying value being stored for the field. |
java.lang.Object |
getVariable(java.lang.String varName)
Get the specified field from the Map for a JXPath variable |
boolean |
hasField(java.lang.String fieldName)
Returns whether the field being requested for mapping has a value that can be mapped to SIF |
boolean |
isDeclaredVariable(java.lang.String varName)
From the Variables interface. |
java.util.Set |
keySet()
Gets the keyset of the underlying Map |
void |
setMap(java.util.Map map)
Sets the Map being used for SIF data mapping operations |
void |
setOverwriteValues(boolean overwriteValues)
This setting influences inbound mapping operations. |
void |
setSIFValue(java.lang.String fieldName,
SIFSimpleType resultingValue,
FieldMapping mapping)
Sets a value that has been retrieved from a SIF Element in an inbound field mapping operation. |
void |
undeclareVariable(java.lang.String varName)
Removes the underlying variable from the Map for JXPath support |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectMapAdaptor(java.util.Map map)
map - The Map to use for SIF Data mapping operations| Method Detail |
|---|
public java.lang.Object getValue(java.lang.String fieldName)
FieldAdaptor
This method is not called during Mappings operations. It may be called by
classes such as the ValueBuilder class
getValue in interface FieldAdaptorfieldName - The field name to retrieve
FieldAdaptor.getValue(java.lang.String)public boolean hasField(java.lang.String fieldName)
FieldAdaptor
hasField in interface FieldAdaptorfieldName - The field name being mapped to SIF
True if there is a value for the specified field that
should be mapped to SIFFieldAdaptor.hasField(java.lang.String)
public void setSIFValue(java.lang.String fieldName,
SIFSimpleType resultingValue,
FieldMapping mapping)
FieldAdaptor
setSIFValue in interface FieldAdaptorfieldName - The field name that is mapped to a SIFElementresultingValue - The value of the SIF elementmapping - The FieldMappings that will be used to set this value or nullFieldAdaptor.setSIFValue(java.lang.String, com.edustructures.sifworks.SIFSimpleType, com.edustructures.sifworks.tools.mapping.FieldMapping)
public SIFSimpleType getSIFValue(java.lang.String fieldName,
SIFTypeConverter typeConverter,
FieldMapping mapping)
FieldAdaptor
getSIFValue in interface FieldAdaptorfieldName - The field name that is mapped to a SIFElementtypeConverter - The converter class for the requested SIF data typemapping - The FieldMapping this value was generated from or null
FieldAdaptor.getSIFValue(java.lang.String, com.edustructures.sifworks.SIFTypeConverter, com.edustructures.sifworks.tools.mapping.FieldMapping)public java.util.Map getMap()
Map being used for SIF data mapping operations
Map being used for SIF data mapping operationspublic void setMap(java.util.Map map)
Map being used for SIF data mapping operations
map - The Map to be used for SIF data mapping operationspublic java.util.Set keySet()
public void setOverwriteValues(boolean overwriteValues)
True,
data coming from SIF can overwrite existing values in the Map. The
default value is False
overwriteValues - True to overwrite existing values in the
Map with data from SIFpublic boolean getOverwriteValues()
public boolean isDeclaredVariable(java.lang.String varName)
isDeclaredVariable in interface org.apache.commons.jxpath.VariablesvarName -
public java.lang.Object getVariable(java.lang.String varName)
getVariable in interface org.apache.commons.jxpath.VariablesvarName - The name of the field
public void declareVariable(java.lang.String varName,
java.lang.Object value)
declareVariable in interface org.apache.commons.jxpath.VariablesvarName - The name of the fieldvalue - The value to assign to the fieldpublic void undeclareVariable(java.lang.String varName)
undeclareVariable in interface org.apache.commons.jxpath.VariablesvarName -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||