EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.oxm.sequenced
Class Setting

java.lang.Object
  extended by org.eclipse.persistence.oxm.sequenced.Setting

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 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
Setting()
           
Setting(java.lang.String namespaceURI, java.lang.String name)
           
 
Method Summary
 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()
           
 DatabaseMapping 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(DatabaseMapping 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Setting

public Setting()

Setting

public Setting(java.lang.String namespaceURI,
               java.lang.String name)
Method Detail

getName

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.

Example

For the XPath personal-info/first-name/text() would correspond to 3 Setting objects with names "personal-info", "first-name", and "text()"


setName

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.

Example

For the XPath personal-info/first-name/text() would correspond to 3 Setting objects with names "personal-info", "first-name", and "text()"


getNamespaceURI

public java.lang.String getNamespaceURI()
Returns:
The namespace URI that qualifies the name of the Setting (if there is one).

setNamespaceURI

public void setNamespaceURI(java.lang.String namespaceURI)
Parameters:
namespaceURI - Specify the namespace URI that qualifies the name of the Setting (if there is one).

getValue

public java.lang.Object getValue()
Returns:
The value corresponding to this setting.

setValue

public void setValue(java.lang.Object value)
Set the value on the Setting. This method will also update the corresponding domain object using the specified mapping.

Parameters:
value -

setValue

public void setValue(java.lang.Object value,
                     boolean updateObject)
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

public void addValue(java.lang.Object value,
                     boolean updateObject,
                     java.lang.Object container)
Parameters:
value -
updateObject -
container -

getObject

public java.lang.Object getObject()
Returns:
The domain object to which this Setting applies.

setObject

public void setObject(java.lang.Object object)
Parameters:
object - This is the domain object to which this Setting belongs.

getMapping

public DatabaseMapping getMapping()
Returns:
The mapping for the domain object that corresponds to this Setting.

setMapping

public void setMapping(DatabaseMapping mapping)
Parameters:
mapping - The mapping for the domain object that corresponds to this Setting.

addChild

public void addChild(Setting childSetting)
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

public Setting getParent()
Returns:
The parent Setting or null if this setting has not parent.

setParent

public void setParent(Setting parentSetting)
Parameters:
parentSetting - The parent Setting or null if this setting has not parent.

getChildren

public java.util.List<Setting> getChildren()
Returns:
The child Settings or null if this setting has no children.

copy

public Setting 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

public Setting copy(java.lang.Object newParent)

copy

public Setting copy(java.lang.Object newParent,
                    java.lang.Object copyValue)

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference