CHJani / google-api-java-client

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

Inner classes for unnamed objects in generated Java library #304

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently we generate top-level classes like this:

http://javadoc.google-api-java-client.googlecode.com/hg/apis/discovery/com/googl
e/api/services/discovery/model/RestDescriptionAuthOauth2Scopes.html

I am not happy with two aspects of this:

1. Class name is too long.  It should be simpler.

2. It clutters up the top-level class names list: 
http://javadoc.google-api-java-client.googlecode.com/hg/apis/discovery/com/googl
e/api/services/discovery/model/package-frame.html

Instead, if we generated these as inner classes, it would solve both of these 
issues.  So it should instead generate something like this:

public class RestDescription {
 public static class Auth {
   public static class Oauth2 {
     public static class Scopes {
...

Note that this way I can declare the import like this:

import 
com.google.api.services.discovery.model.RestDescription.Auth.Oauth2.Scopes;

and then refer to it simply as Scopes in my code.

Original issue reported on code.google.com by rmis...@google.com on 27 Sep 2011 at 3:46

GoogleCodeExporter commented 9 years ago
This issue was reported internally by yanivi@google.com

Original comment by rmis...@google.com on 27 Sep 2011 at 5:43

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 6 Oct 2011 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 28 Oct 2011 at 8:37

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 11 Nov 2011 at 10:02

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 30 Nov 2011 at 4:28