null

null 상수 값입니다.

값을 null로 설정하면 값이 적용되지 않음을 표시하는 데 유용할 수 있습니다.

<?xml version="1.0" encoding="UTF-8"?>
<RuleSet name="Example_null"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation=
"http://www.curamsoftware.com/CreoleRulesSchema.xsd">
  <Class name="Pet">
    <Initialization>
      <Attribute name="name">
        <type>
          <javaclass name="String"/>
        </type>
      </Attribute>
    </Initialization>

  </Class>

  <Class name="Person">

    <!-- 이 개인이 가장 좋아하는 애완동물이거나
         개인에게 애완동물이 없는 경우 널입니다. -->
    <Attribute name="favoritePet">
      <type>
        <ruleclass name="Pet"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

    <!-- 이 개인이 가장 좋아하는
         애완동물이거나 개인에게 애완동물이
         없는 경우 널입니다.

         (간단한) 계산을 수행하기 전에
         null이 되는 favoritePet에 대해
         테스트해야 합니다. -->
    <Attribute name="favoritePetsName">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <choose>
          <type>
            <javaclass name="String"/>
          </type>
          <when>
            <!-- 이 개인에게 가장 좋아하는
                 애완동물이 없으면 가장 좋아하는 애완동물의
                 이름을 널로 계산합니다. -->
            <condition>
              <equals>
                <reference attribute="favoritePet"/>
                <null/>
              </equals>
            </condition>
            <value>
              <null/>
            </value>
          </when>
          <otherwise>
            <value>
              <!-- 가장 좋아하는 애완동물의 이름을 가져옵니다. -->
              <reference attribute="name">
                <reference attribute="favoritePet"/>
              </reference>
            </value>
          </otherwise>
        </choose>

      </derivation>
    </Attribute>

  </Class>

</RuleSet>