What steps will reproduce the problem?
User class has a password field:
class User {
String username;
@Strategy(deserialize=true, serialize=false)
String password;
}
What is the expected output? What do you see instead?
fromJson() should get password
toJson() should ignore password
but ExclusionStrategy.shouldSkipField() missing context information:
public boolean shouldSkipField(FieldAttributes attrs) {
Strategy s = attrs.getAnnotation(Strategy.class);
if (isSerializing() && s!=null && !s.serialize)
return false;
return true;
}
cannot determin isSerializing() in shouldSkipField() method.
What version of the product are you using? On what operating system?
Gson-1.6
Please provide any additional information below.
Maybe provides a Context argument?
Original issue reported on code.google.com by askxuefeng@gmail.com on 30 Dec 2010 at 2:09
Original issue reported on code.google.com by
askxuefeng@gmail.com
on 30 Dec 2010 at 2:09