set

Top  Previous  Next

- values*

- separator [,]

 

Attributes

 

values: The allowed values, for example, values="yes,no"

 

separator: Allows you to specify your own separator. Common separators are :;,|

 

Notes:

 

By specifying your value as Male(M) you are instructing the code generator to produce a Java enumeration with the name "Male" but with the value "M". This allows for more descriptive enumeration names.

 

<Gender minOccurs="0" type="set" values="Male(M),Female(F)">M</Gender>

 

The Schema

 

<schema packageScope="com.wickedfastsolutions.demo.domain">
  <Order>
      <OrderNumber type="integer" maxLength="8">12345678</OrderNumber>
      <OrderDate type="date" format="yyyy-MM-dd" minLength="10" maxLength="10">2003-02-15</OrderDate>
      <CustomerNumber type="string" length="8">P1234567</CustomerNumber>
      <PaymentMethod type="set" values="Cash,Credit" maxLength="20">Cash</PaymentMethod>
      <OrderLines>
          <OrderLineNumber type="integer" minValue="1" maxValue="32766" maxLength="5">1</OrderLineNumber>
          <OrderItem type="string" maxLength="15">GT-AL-1256</OrderItem>
          <Quantity type="integer" minValue="1" maxValue="32766" maxLength="5">10</Quantity>
          <UnitOfMeasure type="set" values="EA,DZ,GR" maxLength="2">EA</UnitOfMeasure>
          <Price type="double" scale="2" maxLength="8">123.45</Price>
          <PriceCurrency type="set" values="USD|CAD|GBP" separator="|" maxLength="3">USD</PriceCurrency>
      </OrderLines>
  </Order>
</schema>