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

Field#getGenericType instead of JSONTypeHint #19

Open
OlegYch opened this issue Mar 18, 2011 · 1 comment
Open

Field#getGenericType instead of JSONTypeHint #19

OlegYch opened this issue Mar 18, 2011 · 1 comment
Assignees

Comments

@OlegYch
Copy link

OlegYch commented Mar 18, 2011

Why not to use
val field = context.get.getDeclaredField(props.get(name).get)
val fieldInnerType = field.getGenericType.asInstanceOf[ParameterizedType].getActualTypeArguments()(0)

instead of
val field = context.get.getDeclaredField(props.get(name).get)
val ann = field.getAnnotation(classOf[JSONTypeHint])

when determining types of elements in list field?
For example here https://github.com/debasishg/sjson/blob/master/src/main/scala/sjson/json/JsBean.scala#L182

Thanks,
Oleg.

@debasishg
Copy link
Owner

Thanks for the feedback .. I will take a look the moment I have some time ..

@ghost ghost assigned debasishg Apr 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants