Previous Topic

Next Topic

Book Contents

Book Index

Default Mapping

On this page there is detailed information about the Target Device Item properties that could not be mapped to Source Device Item properties. They should have specific default values different from Java ones. For example Java defines null for objects or 0 for numbers, etc. In this situation the <defaults> element is used.

<defaults>

The <defaults> element is optional. It has one or many <default> child elements.

<default>

The <default> element is required. It has the required attribute "name" that holds the name of the Target Device Item property. The representation of the Target Device Item property value depends on the type of the property. On Mapping XML Value Representation page there is detailed information about how to represent the different type of values.

The <default> element does not support XML attribute "xsi:nil" because the described element must not be set to null. When the property value has to be null, then this property must not be described. The other XML attribute described on Mapping XML Value Representation page are related to the <default> tag too.

For Example:

...

<defaults>

  <default name="range">

    <map-value>

      <element key="min">

        <map-value>

          <element key="value">

            <map-value>

              <element key="value" value="-273" />

            </map-value>

          </element>

          <element key="unit">

            <map-value>

              <element key="symbol" value="&#8451;" />

            </map-value>

          </element>

        </map-value>

      </element>

      <element key="max">

        <map-value>

          <element key="value">

            <map-value>

              <element key="value" script="#{java.lang.Integer.MAX_VALUE}" />

            </map-value>

          </element>

          <element key="unit">

            <map-value>

              <element key="symbol" value="&#8451;" />

            </map-value>

          </element>

        </map-value>

      </element>

    </map-value>

  </default>

</defaults>

...