java – 如何从序列化中排除GWT中的对象属性?

有没有办法从GWT序列化中排除Serializable对象中的原始和对象属性
public class Provider implements Serializable{  
    public Provider() {  
    }  

    //Id like to exclude this property:   
        private String password;  
    //  

    private String address1;  
    private String address2;  
    private String companyName;  
    private String phone;  
}

解决方法

I was hoping for something like
special annotation

我想你要找的是@GwtTransient

@GwtTransient,an annotation that
tells GWT RPC to treat a field as if
it were marked with the Java transient
keyword,even though it’s not.

This annotation means the same thing
as the transient keyword,
but it is ignored by all serialization
systems other than GWT’s. Usually the
transient keyword should be used in
preference to this annotation.
However,for types used with multiple
serialization systems,it can be
useful.

参考:@GwtTransient

相关文章

最近看了一下学习资料,感觉进制转换其实还是挺有意思的,尤...
/*HashSet 基本操作 * --set:元素是无序的,存入和取出顺序不...
/*list 基本操作 * * List a=new List(); * 增 * a.add(inde...
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变...
集合的操作Iterator、Collection、Set和HashSet关系Iterator...
接口中常量的修饰关键字:public,static,final(常量)函数...