SmartDroidDeveloper / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Support nested elements in @Key annotation #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The @Key("param") annotation does not support nested tags per Partial Response 
idioms.  For example: @Key("gf:symbol/@symbol") should return the symbol 
attribute from the symbol element within the element being parsed, without 
requiring the user to create a new class as an intermediary.  1.2.1-alpha fails 
to parse and returns null.  Support for nested elements would be of great help 
in parsing as some of the Google APIs nest rather deeply and it would be useful 
to be able to flatten the structure somewhat.  Another example is 
@Key("gf:positionData/gf:marketValue/gf:money/@amount" -- Does that really need 
three nested classes to parse?

Original issue reported on code.google.com by jcwen...@gmail.com on 6 Dec 2010 at 2:28

GoogleCodeExporter commented 9 years ago
I've gotten multiple features requests like this from other sources as well.  
Thanks for filing a formal feature request.  Good explanation of the benefits 
of such a feature.  It would make the XML data structure much easier to work 
with, e.g. not having to check for nulls for the intermediary classes.

Unfortunately, it would be a rather complicated feature to implement.  So 
although I agree it would make it easier to use, it has not yet been determined 
if the extra complexity in the implementation is worth the user benefit.

Original comment by yan...@google.com on 6 Dec 2010 at 8:16

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 8 Jan 2011 at 6:30

GoogleCodeExporter commented 9 years ago
Ported to:
http://code.google.com/p/google-http-java-client/issues/detail?id=11

Original comment by yan...@google.com on 4 Jun 2011 at 4:09