You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try generate classes from an XSD that contains type="date", type="dateTime" or type="base64Binary" as an attribute or element type, I get a NullPointerException, as follows:
$ java -jar android-jaxb-1.0.1.jar schemas/testSchema.xsd --destination . --package com.test Code Generator Initialized. Destination Directory: . [Element /GetCountriesResponse Min Occurs: null, Max Occurs: null ] of type [null][Start of sequence Min Occurs: 1, Max Occurs: 1 ] [Element /GetCountriesResponse/Countries Min Occurs: 0, Max Occurs: -1 ] of type [TestElement] [Attribute /GetCountriesResponse/Countries/@code Min Occurs: 1, Max Occurs: 1 ] of type [string] [Attribute /GetCountriesResponse/Countries/@description Min Occurs: 1, Max Occurs: 1 ] of type [string] [Attribute /GetCountriesResponse/Countries/@date Min Occurs: 1, Max Occurs: 1 ] of type [date] Exception in thread "main" java.lang.NullPointerException at com.sun.codemodel.JVar.annotate(JVar.java:188) at com.mickoo.xml.xsd2simplexml.GeneratedClass.addElement(GeneratedClass.java:62) at com.mickoo.xml.xsd2simplexml.SchemaParser.addSimpleType(SchemaParser.java:300) at com.mickoo.xml.xsd2simplexml.SchemaParser.processAttribute(SchemaParser.java:263) at com.mickoo.xml.xsd2simplexml.SchemaParser.processComplexType(SchemaParser.java:242) at com.mickoo.xml.xsd2simplexml.SchemaParser.processElement(SchemaParser.java:368) at com.mickoo.xml.xsd2simplexml.SchemaParser.processParticle(SchemaParser.java:208) at com.mickoo.xml.xsd2simplexml.SchemaParser.processGroup(SchemaParser.java:219) at com.mickoo.xml.xsd2simplexml.SchemaParser.processParticle(SchemaParser.java:204) at com.mickoo.xml.xsd2simplexml.SchemaParser.processComplexType(SchemaParser.java:232) at com.mickoo.xml.xsd2simplexml.SchemaParser.processElement(SchemaParser.java:368) at com.mickoo.xml.xsd2simplexml.SchemaParser.parse(SchemaParser.java:67) at com.mickoo.xml.xsd2simplexml.Main.main(Main.java:80)
Ideally, it would generate fields with the following types:
type="date" -> java.sql.Date
type="dateTime" -> java.sql.Timestamp
type="base64Binary" -> byte[]
But I'm not sure how well that will play with simplexml.
When I try generate classes from an XSD that contains type="date", type="dateTime" or type="base64Binary" as an attribute or element type, I get a NullPointerException, as follows:
$ java -jar android-jaxb-1.0.1.jar schemas/testSchema.xsd --destination . --package com.test Code Generator Initialized. Destination Directory: . [Element /GetCountriesResponse Min Occurs: null, Max Occurs: null ] of type [null][Start of sequence Min Occurs: 1, Max Occurs: 1 ] [Element /GetCountriesResponse/Countries Min Occurs: 0, Max Occurs: -1 ] of type [TestElement] [Attribute /GetCountriesResponse/Countries/@code Min Occurs: 1, Max Occurs: 1 ] of type [string] [Attribute /GetCountriesResponse/Countries/@description Min Occurs: 1, Max Occurs: 1 ] of type [string] [Attribute /GetCountriesResponse/Countries/@date Min Occurs: 1, Max Occurs: 1 ] of type [date] Exception in thread "main" java.lang.NullPointerException at com.sun.codemodel.JVar.annotate(JVar.java:188) at com.mickoo.xml.xsd2simplexml.GeneratedClass.addElement(GeneratedClass.java:62) at com.mickoo.xml.xsd2simplexml.SchemaParser.addSimpleType(SchemaParser.java:300) at com.mickoo.xml.xsd2simplexml.SchemaParser.processAttribute(SchemaParser.java:263) at com.mickoo.xml.xsd2simplexml.SchemaParser.processComplexType(SchemaParser.java:242) at com.mickoo.xml.xsd2simplexml.SchemaParser.processElement(SchemaParser.java:368) at com.mickoo.xml.xsd2simplexml.SchemaParser.processParticle(SchemaParser.java:208) at com.mickoo.xml.xsd2simplexml.SchemaParser.processGroup(SchemaParser.java:219) at com.mickoo.xml.xsd2simplexml.SchemaParser.processParticle(SchemaParser.java:204) at com.mickoo.xml.xsd2simplexml.SchemaParser.processComplexType(SchemaParser.java:232) at com.mickoo.xml.xsd2simplexml.SchemaParser.processElement(SchemaParser.java:368) at com.mickoo.xml.xsd2simplexml.SchemaParser.parse(SchemaParser.java:67) at com.mickoo.xml.xsd2simplexml.Main.main(Main.java:80)
testSchema.xsd.txt
The text was updated successfully, but these errors were encountered: