Example 1: Map a JavaBean property to an XML attribute.
//Example: Code fragment
public class USPrice {
@XmlAttribute
public java.math.BigDecimal getPrice() {...} ;
public void setPrice(java.math.BigDecimal ) {...};
}
<!-- Example: XML Schema fragment -->
<xs:complexType name="USPrice">
<xs:sequence>
</xs:sequence>
<xs:attribute name="price" type="xs:decimal"/>
</xs:complexType>
Example 2: Map a JavaBean property to an XML attribute with anonymous type.
Example 1: Map a JavaBean property to an XML attribute.
//Example: Code fragment
public class USPrice {
@XmlAttribute
public java.math.BigDecimal getPrice() {...} ;
public void setPrice(java.math.BigDecimal ) {...};
}
<!-- Example: XML Schema fragment -->
<xs:complexType name="USPrice">
<xs:sequence>
</xs:sequence>
<xs:attribute name="price" type="xs:decimal"/>
</xs:complexType>
Example 2: Map a JavaBean property to an XML attribute with anonymous type.
Example 1: Map a JavaBean property to an XML attribute.
//Example: Code fragment
public class USPrice {
@XmlAttribute
public java.math.BigDecimal getPrice() {...} ;
public void setPrice(java.math.BigDecimal ) {...};
}
<!-- Example: XML Schema fragment -->
<xs:complexType name="USPrice">
<xs:sequence>
</xs:sequence>
<xs:attribute name="price" type="xs:decimal"/>
</xs:complexType>
Example 2: Map a JavaBean property to an XML attribute with anonymous type.
Name of the XML Schema attribute. By default, the XML Schema attribute name is derived from the JavaBean property name.
Default:
"##default"
method:required() [CHANGED]
required
public abstract boolean required
boolean required
Specifies if the XML Schema attribute is optional or required. If true, then the JavaBean property is mapped to a XML Schema attribute that is required. Otherwise it is mapped to a XML Schema attribute that is optional.
Default:
false
required
public abstract boolean required
Specifies if the XML Schema attribute is optional or required. If true, then the JavaBean property is mapped to a XML Schema attribute that is required. Otherwise it is mapped to a XML Schema attribute that is optional.
Default:
false
required
boolean required
Specifies if the XML Schema attribute is optional or required. If true, then the JavaBean property is mapped to a XML Schema attribute that is required. Otherwise it is mapped to a XML Schema attribute that is optional.