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

Support of gYearMonth, gYear, gMonthDay, gMonth, gDay types. #73

Closed
duschata opened this issue Mar 30, 2015 · 7 comments
Closed

Support of gYearMonth, gYear, gMonthDay, gMonth, gDay types. #73

duschata opened this issue Mar 30, 2015 · 7 comments
Assignees
Milestone

Comments

@duschata
Copy link
Contributor

Hello All,
I've tried to compile a XSD Schema including xsd:gYear(...) to a mapping file. Marshalling and unmarshalling fails. Take a look at the attached index.html. I've tried to fix it (also available in the .zip), its not implemented yet (Snapshot 2.1.5). Have you planned to implement the support for gYear...?.
Kind Regards
Thomas Grabietz
file: https://mega.co.nz/#!ylkhXKgS!WhHt0OQSCSA91DvxB9BHVl2wx4g8G7DoKhZNcHK8N_Q

@highsource highsource added the bug label Mar 30, 2015
@highsource
Copy link
Owner

I can't access your attachment, sorry. Please send me the mail to valikov(-)gmx.net.

Actually gYear, gMonth and so on should be supported already, see here.

@highsource highsource modified the milestones: 2.1.5, 2.2.0 Mar 30, 2015
@highsource highsource self-assigned this Mar 30, 2015
@highsource
Copy link
Owner

Or even better please make a JSFiddle (see this example).

@highsource
Copy link
Owner

highsource added a commit that referenced this issue Mar 30, 2015
@highsource
Copy link
Owner

@highsource
Copy link
Owner

Reproduced.

The status is: g* types are really not supported yet.

  • Jsonix.Schema.XSD.Calendar should be extended to support gYearMonth, gYear, gMonthDay, gMonth, gDay types.
  • Jsonix.Schema.XSD.G* types extend Jsonix.Schema.XSD.Calendar and call the appropriate parse/print methods.

@highsource highsource changed the title Support of gYear, gMonth, gDay attributes Support of gYearMonth, gYear, gMonthDay, gMonth, gDay types. Mar 30, 2015
@highsource
Copy link
Owner

Implementation hints:

  • Calendar should detect the pattern here. The best would be probably with a regexp. These are good hints, but I won't use the code directly because I'm not sure those expressions are correct and also because of the license. Better to write regular expressions from scratch based on the spec 3.2.10 - 3.2.14.
  • Add parseGYearMonth ... parseGDay methods called when a certain regexp is detected in parse
  • The reverse in print: check what the object contains, call the printGYearMonth...printGDay accordingly, throw an error if the combination does not match any type.
  • In GYearMonth ... GDay, extend the Calendar and call the appropriate print/parse methods. Validate the input both on print and parse.
  • Tests go here, will probably make sense splitting in smaller test methods. To build, you'll need to mvn clean install scripts and then mvn clean install in nodejs/scripts and then you should be able to npm test. This is awkward at the moment.
  • Issue-speicific test is here, at the moment commented out
  • Relevant XJC plugin class is here, basically you'll have to comment out the mappings.
  • This is more or less it. Probably a few tests will fail or will have to be extended, but that's minor.

@highsource highsource removed this from the 2.2.0 milestone Apr 5, 2015
highsource added a commit that referenced this issue Apr 9, 2015
highsource added a commit that referenced this issue Apr 9, 2015
@highsource highsource added this to the 2.2.2 milestone Apr 17, 2015
highsource added a commit that referenced this issue May 3, 2015
highsource added a commit that referenced this issue May 4, 2015
highsource added a commit that referenced this issue May 4, 2015
highsource added a commit that referenced this issue May 6, 2015
highsource added a commit that referenced this issue May 6, 2015
highsource added a commit that referenced this issue May 6, 2015
highsource added a commit that referenced this issue May 6, 2015
highsource added a commit that referenced this issue Jun 20, 2015
highsource added a commit that referenced this issue Jun 20, 2015
highsource added a commit that referenced this issue Jun 20, 2015
highsource added a commit that referenced this issue Jun 20, 2015
highsource added a commit that referenced this issue Jun 20, 2015
highsource added a commit that referenced this issue Jun 20, 2015
highsource added a commit that referenced this issue Jun 20, 2015
highsource added a commit that referenced this issue Jun 21, 2015
highsource added a commit that referenced this issue Jun 28, 2015
from date (as it is probably the most reasonable default).
highsource added a commit that referenced this issue Jun 28, 2015
@highsource highsource modified the milestones: 2.3.0, 2.2.2 Jun 28, 2015
highsource added a commit that referenced this issue Jun 28, 2015
@highsource
Copy link
Owner

I think this works well enough, so I'll close this issue. Please test and file new issues if you miss something.

highsource added a commit that referenced this issue Jun 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants