public class Setting
extends java.lang.Object
Setting objects are used to control the order in which the mappings for Sequenced Objects are processed.
Example 1Setting piSetting = new Setting(null, "personal-info"); Setting fnSetting = new Setting(null, "first-name"); piSetting.addChild(fnSetting); Setting fnTextSetting = new Setting(null, "text()"); fnTextSetting.setObject(customerObject); fnTextSetting.setMapping(customerFirstNameMapping); fnTextSetting.setValue("Jane"); fnSetting.addChild(fnTextSetting); Setting lnSetting = new Setting(null, "last-name"); piSetting.addChild(lnSetting); Setting lnTextSetting = new Setting(null, "text()"); lnTextSetting.setObject(customerObject); lnTextSetting.setMapping(customerLastNameMapping); lnTextSetting.setValue("Doe"); lnSetting.getSequence().add(lnTextSetting);
<personal-info> <first-name>Jane</first-name> <last-name>Doe</last-name> </personal-info>Example 2
Setting fnpiSetting = new Setting(null, "personal-info"); Setting fnSetting = new Setting(null, "first-name"); fnpiSetting.addChild(fnSetting); Setting fnTextSetting = new Setting(null, "text()"); fnTextSetting.setObject(customerObject); fnTextSetting.setMapping(customerFirstNameMapping); fnTextSetting.setValue("Jane"); fnSetting.addChild(fnTextSetting); Setting lnpiSetting = new Setting(null, "personal-info"); Setting lastNameSetting = new Setting(null, "last-name"); lnpiSetting.addChild(lnSetting); Setting lnTextSetting = new Setting(null, "text()"); lnTextSetting.setObject(customerObject); lnTextSetting.setMapping(customerLastNameMapping); lnTextSetting.setValue("Doe"); lnSetting.addChild(lnTextSetting);
<personal-info> <first-name>Jane</first-name> </personal-info> <personal-info> <last-name>Doe</last-name> </personal-info>
Constructor and Description |
---|
Setting() |
Setting(java.lang.String namespaceURI,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(Setting childSetting) |
void |
addValue(java.lang.Object value,
boolean updateObject,
java.lang.Object container) |
Setting |
copy() |
Setting |
copy(java.lang.Object newParent) |
Setting |
copy(java.lang.Object newParent,
java.lang.Object copyValue) |
java.util.List<Setting> |
getChildren() |
CoreMapping |
getMapping() |
java.lang.String |
getName()
Return the name of the setting.
|
java.lang.String |
getNamespaceURI() |
java.lang.Object |
getObject() |
Setting |
getParent() |
java.lang.Object |
getValue() |
void |
setMapping(CoreMapping mapping) |
void |
setName(java.lang.String name)
Specify the name of the setting.
|
void |
setNamespaceURI(java.lang.String namespaceURI) |
void |
setObject(java.lang.Object object) |
void |
setParent(Setting parentSetting) |
void |
setValue(java.lang.Object value)
Set the value on the Setting.
|
void |
setValue(java.lang.Object value,
boolean updateObject) |
public Setting()
public Setting(java.lang.String namespaceURI, java.lang.String name)
public java.lang.String getName()
Return the name of the setting. The name of the setting corresponds to a fragment of an XPath in an object-to-XML mapping.
ExampleFor the XPath personal-info/first-name/text() would correspond to 3 Setting objects with names "personal-info", "first-name", and "text()"
public void setName(java.lang.String name)
Specify the name of the setting. The name of the setting corresponds to a fragment of an XPath in an object-to-XML mapping.
ExampleFor the XPath personal-info/first-name/text() would correspond to 3 Setting objects with names "personal-info", "first-name", and "text()"
public java.lang.String getNamespaceURI()
public void setNamespaceURI(java.lang.String namespaceURI)
namespaceURI
- Specify the namespace URI that qualifies the name of the Setting (if
there is one).public java.lang.Object getValue()
public void setValue(java.lang.Object value)
value
- public void setValue(java.lang.Object value, boolean updateObject)
value
- The value to be set on the Setting.updateObject
- This flag indicates if an update is performed
on the corresponding domain object using the specified mapping.public void addValue(java.lang.Object value, boolean updateObject, java.lang.Object container)
value
- updateObject
- container
- public java.lang.Object getObject()
public void setObject(java.lang.Object object)
object
- This is the domain object to which this Setting belongs.public CoreMapping getMapping()
public void setMapping(CoreMapping mapping)
mapping
- The mapping for the domain object that corresponds to this Setting.public void addChild(Setting childSetting)
childSetting
- This setting will be added to the parent. The parenting
information will be updated automatically. A child must only be added to one parent.public Setting getParent()
public void setParent(Setting parentSetting)
parentSetting
- The parent Setting or null if this setting has not parent.public java.util.List<Setting> getChildren()
public Setting copy()
public Setting copy(java.lang.Object newParent)
public Setting copy(java.lang.Object newParent, java.lang.Object copyValue)