public class Foo
{
public transient int a;
public String b;
public Bar boo;
public Foo(int a, String b, Bar c)
{
this.a = a;
this.b = b;
this.boo = c;
}
}
属性 a 将不会序列化为 XML。
Mark the fields to skip with the 'transient' keyword. Example based on your code:
public class Foo
{
public transient int a;
public String b;
public Bar boo;
public Foo(int a, String b, Bar c)
{
this.a = a;
this.b = b;
this.boo = c;
}
}
发布评论
评论(2)
来自 Xtream
尝试 www.google.com
From Xtream
Try www.google.com
使用“transient”关键字标记要跳过的字段。基于您的代码的示例:
属性 a 将不会序列化为 XML。
Mark the fields to skip with the 'transient' keyword. Example based on your code:
The property a will not be serialized to XML.