Class Setting
java.lang.Object
org.eclipse.persistence.oxm.sequenced.Setting
Setting objects are used to control the order in which the mappings for Sequenced Objects are processed.
Example 1
Setting 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcopy()getName()Return the name of the setting.getValue()voidsetMapping(CoreMapping mapping) voidSpecify the name of the setting.voidsetNamespaceURI(String namespaceURI) voidvoidvoidSet the value on the Setting.void
-
Constructor Details
-
Setting
public Setting() -
Setting
-
-
Method Details
-
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()"
-
setName
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()"
-
getNamespaceURI
- Returns:
- The namespace URI that qualifies the name of the Setting (if there is one).
-
setNamespaceURI
- Parameters:
namespaceURI- Specify the namespace URI that qualifies the name of the Setting (if there is one).
-
getValue
- Returns:
- The value corresponding to this setting.
-
setValue
Set the value on the Setting. This method will also update the corresponding domain object using the specified mapping.- Parameters:
value-
-
setValue
- Parameters:
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.
-
addValue
- Parameters:
value-updateObject-container-
-
getObject
- Returns:
- The domain object to which this Setting applies.
-
setObject
- Parameters:
object- This is the domain object to which this Setting belongs.
-
getMapping
- Returns:
- The mapping for the domain object that corresponds to this Setting.
-
setMapping
- Parameters:
mapping- The mapping for the domain object that corresponds to this Setting.
-
addChild
- Parameters:
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.
-
getParent
- Returns:
- The parent Setting or null if this setting has not parent.
-
setParent
- Parameters:
parentSetting- The parent Setting or null if this setting has not parent.
-
getChildren
- Returns:
- The child Settings or null if this setting has no children.
-
copy
- Returns:
- A copy of the Setting object and its child Setting objects. The copy contains references to the original object, mapping, and value.
-
copy
-
copy
-