Class Setting

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

public class Setting extends 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 Details

    • Setting

      public Setting()
    • Setting

      public Setting(String namespaceURI, String name)
  • Method Details

    • getName

      public 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(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 String getNamespaceURI()
      Returns:
      The namespace URI that qualifies the name of the Setting (if there is one).
    • setNamespaceURI

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

      public Object getValue()
      Returns:
      The value corresponding to this setting.
    • setValue

      public void setValue(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(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(Object value, boolean updateObject, Object container)
      Parameters:
      value -
      updateObject -
      container -
    • getObject

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

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

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

      public void setMapping(CoreMapping 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 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(Object newParent)
    • copy

      public Setting copy(Object newParent, Object copyValue)