|
I'm adding a field
to a previous schema and am adding an element to an existing ComplexType at then
end. What i would like is that any code that begins using the generated
classes will automatically generate the this ComplexType with the added simple
element defaulting to a certain value. That is, i don't want all previous
users to have to go and change their code when i know what the default should
be.
I figured i'd add
the element in the following way. I assumed that the default="E" would, in
some way, get me what i want. Well, if i instantiate the object and read
the type, it is, of course null.
So, is there any way
i can accomplish this? Is there any way that i can add an element to a
complex type and have the xmlbeans generated classes handle a default value for
it?
thanks for any
help.
<xs:element name="Type" default="E" minOccurs="1"
maxOccurs="1">
<xs:annotation> <xs:documentation>Error Type, must be (E)rror, (I)nformational, (W)arning</xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="I"/> <xs:enumeration value="E"/> <xs:enumeration value="W"/> </xs:restriction> </xs:simpleType> </xs:element> |
- Default value support in java classes supported? Paul Grillo
- RE: Default value support in java classes suppor... Radu Preotiuc-Pietro

