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 format annotations for better parsing #17

Closed
neilmcguigan opened this issue Sep 2, 2014 · 5 comments
Closed

Support format annotations for better parsing #17

neilmcguigan opened this issue Sep 2, 2014 · 5 comments
Assignees
Milestone

Comments

@neilmcguigan
Copy link

For example, to parse a Date I need to register a Converter class.

It would be slicker if I could put a @DateFormat("...some simpledateformat string...") annotation on the interface field, and XMLBeam would use that to parse the date.

Same for ints, etc.

@SvenEwald
Copy link
Owner

Actually, registering a Converter class is the preferred way of creating a Date instance.
I see the conversion options as part of the global configuration and not something to be repeated per projection method. But I understand the wish for easier conversion configuration. Need to think about that ...

@SvenEwald SvenEwald added this to the 1.4.1 milestone Oct 13, 2014
@SvenEwald SvenEwald self-assigned this Oct 13, 2014
@SvenEwald
Copy link
Owner

planed for 1.4.1

@SvenEwald SvenEwald reopened this Oct 13, 2014
@SvenEwald
Copy link
Owner

Already in development, but it's more tricky than thought. I want externalizers to be able to contribute the format specs, just like the XPaths.

@SvenEwald SvenEwald modified the milestones: 1.4.2, 1.4.1 Nov 6, 2014
@SvenEwald
Copy link
Owner

It's more complicated than it looks at the first place. The formatting needs to be applied to the evaluation result and to any parameter used in the expression. Need to update the grammar. Now planed for 1.4.2.

@SvenEwald
Copy link
Owner

Finally included this feature in current release (1.4.2). It is not an additional annotation, but using an extension to XPath. This way multiple formats can be specified in one expression and externalizers work transparently. Have fun with this feature!

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