Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GSON exclusionStrategy

 
preeti vivek gupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am having trouble with GSON exclusionStrategy implemenation.I need to implement GSON serialization filtering based on template. in GSON. in GSON exclusionStrategy , shouldSkipField , I need to know field's concrete class, where am I in class hierarchy


My class structure is as following:-

class A{
String id;
}

class B{
String bb;
String bbb;
}

class c extends A{
String cVal;
B bObj;
}


I want to access 'id' field via class c, but id field's declaring class comes as A instead of c.

Thanks in advance,
Preeti
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic