Reputation: 578
i am working on a java application for my company which among other things takes an XML for which i have a schema as an input.
IDE: NetBeans 8.0 Java: JDK 1.6 (i know, i know...)
In the schema one of the element types has two attributes that are requiered:
<xs:complexType name="InsertType">
<xs:attribute name="ID" type="NameType" use="required" />
<xs:attribute name="Priority" type="xs:int" use="required" />
</xs:complexType>
Now the generated class for this complextype looks like this:
public class InsertType {
@XmlAttribute(name = "ID")
protected String id;
@XmlAttribute(name = "Priority")
protected BigInteger priority;
...
}
Naming conventions for XML attribute names aside (i just got this schema and naming convention is just one of my feedback topics), why do i get "BigInteger" here as a datatype for "Priority"? The original schema i received looked like this for "Priority"
<xs:attribute name="Priority" type="xs:integer" use="optional">
So i can see why xs:integer plus "optional" would trigger "BigInteger" generation, but i already changed type to "xs:int" and use to required, which i gathered was the equivalent to "minOccurs='1'" that would (hopefully) solve the problem for an element.
Does anyone have an idea what i should look into next? I am at a loss here and the google hits i found all pointed to usage of "xs:int" instead of "xs:integer" and "minOccurs='1'".
Thank you
EDIT: I forgot to mention, and this might be essential, that the binding is created from two schemas, one including the other. The first or main schema describes the overall architecture of the XML. The second consists mainly of all the type definitions used. Since the first contains type-definitions as well the split between those two is not necessary. But can it have anything to do with the above mentioned problem?
Upvotes: 2
Views: 1363
Reputation: 578
Ok, after working through all the details again i found the answer myself. I was wondering why none of my changes to the attribute were reflected in the generated classes, so i changed the annotations as well. Those changes were also not reflected in the generated classes even after i deleted the build directory of my project.
The solution, plain and simple (and i am really embarrassed to admit that) was to delete Netbeans cache folder (found in C:\Users\\\\Netbeans\Cache\8.0), restart netbeans and have the classes generated again.
Upvotes: 1