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

gson don't support parse Anonymous-Class-Object #1639

Closed
lusson-luo opened this issue Jan 10, 2020 · 2 comments
Closed

gson don't support parse Anonymous-Class-Object #1639

lusson-luo opened this issue Jan 10, 2020 · 2 comments

Comments

@lusson-luo
Copy link

lusson-luo commented Jan 10, 2020

if i create a Anonymous-Class object, gson can't parse it, will set null value.
I create object like this way。

new List() {
  {
    add(new Filter() {
      {
        setName("");
        setCode("dd")
      }
    });
    add(new Filter() {
      {
        setName("");
        setCode("dd")
      }
    });
  }
}

and gson parse like that

'filter':[
    	null,
    	null
    ]
@baha2046
Copy link

u should read the front page about how to due with non static inner class

@lusson-luo
Copy link
Author

lusson-luo commented Jan 19, 2020

i search issue for inner class and find many same issues,and the answer is gson will not support to this, cause by gson design boundary? #298
there are other issues about serialize anonymous object, and the answers are will not support:
#1510
#717
cause of here is open issue #1510 ,so i close mine.

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