Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE generating classes from XSD with type=date, dateTime or base64Binary #9

Open
barrypitman opened this issue Jan 31, 2016 · 2 comments
Labels

Comments

@barrypitman
Copy link

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

@yeshodhan yeshodhan added the bug label Feb 1, 2016
@yeshodhan
Copy link
Owner

Taking a look.

@barrypitman
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants