java类java.beans.DefaultPersistenceDelegate的实例源码

Test4936682.java 文件源码 项目:jdk8u-jdk 阅读 20 收藏 0 点赞 0 评论 0
protected void initialize(XMLEncoder encoder) {
    encoder.setPersistenceDelegate(
            OuterClass.InnerClass.class,
            new DefaultPersistenceDelegate() {
                protected Expression instantiate(Object oldInstance, Encoder out) {
                    OuterClass.InnerClass inner = (OuterClass.InnerClass) oldInstance;
                    OuterClass outer = inner.getOuter();
                    return new Expression(inner, outer, "getInner", new Object[0]);
                }
            }
    );
}
Test4679556.java 文件源码 项目:jdk8u-jdk 阅读 24 收藏 0 点赞 0 评论 0
protected void initialize(XMLEncoder encoder) {
    encoder.setPersistenceDelegate(C.class, new DefaultPersistenceDelegate() {
        protected Expression instantiate(Object oldInstance, Encoder out) {
            C c = (C) oldInstance;
            return new Expression(c, c.getX(), "createC", new Object[] {});
        }
    });
}
TestPersistenceDelegate.java 文件源码 项目:openjdk-jdk10 阅读 21 收藏 0 点赞 0 评论 0
public static void main(String[] args) throws InterruptedException {
    Class<?> type = TestPersistenceDelegate.class;
    test(type, DefaultPersistenceDelegate.class);
    ENCODER.setPersistenceDelegate(type, new BeanPersistenceDelegate());
    test(type, BeanPersistenceDelegate.class);
    ENCODER.setPersistenceDelegate(type, null);
    test(type, DefaultPersistenceDelegate.class);
    // the following tests fails on previous build
    test(Bean.class, BeanPersistenceDelegate.class);
    test(BeanPersistenceDelegate.class, BeanPersistenceDelegate.class);
}
Test4936682.java 文件源码 项目:openjdk-jdk10 阅读 20 收藏 0 点赞 0 评论 0
protected void initialize(XMLEncoder encoder) {
    encoder.setPersistenceDelegate(
            OuterClass.InnerClass.class,
            new DefaultPersistenceDelegate() {
                protected Expression instantiate(Object oldInstance, Encoder out) {
                    OuterClass.InnerClass inner = (OuterClass.InnerClass) oldInstance;
                    OuterClass outer = inner.getOuter();
                    return new Expression(inner, outer, "getInner", new Object[0]);
                }
            }
    );
}
Test4679556.java 文件源码 项目:openjdk-jdk10 阅读 23 收藏 0 点赞 0 评论 0
protected void initialize(XMLEncoder encoder) {
    encoder.setPersistenceDelegate(C.class, new DefaultPersistenceDelegate() {
        protected Expression instantiate(Object oldInstance, Encoder out) {
            C c = (C) oldInstance;
            return new Expression(c, c.getX(), "createC", new Object[] {});
        }
    });
}
TestPersistenceDelegate.java 文件源码 项目:openjdk9 阅读 21 收藏 0 点赞 0 评论 0
public static void main(String[] args) throws InterruptedException {
    Class<?> type = TestPersistenceDelegate.class;
    test(type, DefaultPersistenceDelegate.class);
    ENCODER.setPersistenceDelegate(type, new BeanPersistenceDelegate());
    test(type, BeanPersistenceDelegate.class);
    ENCODER.setPersistenceDelegate(type, null);
    test(type, DefaultPersistenceDelegate.class);
    // the following tests fails on previous build
    test(Bean.class, BeanPersistenceDelegate.class);
    test(BeanPersistenceDelegate.class, BeanPersistenceDelegate.class);
}
Test4936682.java 文件源码 项目:openjdk9 阅读 20 收藏 0 点赞 0 评论 0
protected void initialize(XMLEncoder encoder) {
    encoder.setPersistenceDelegate(
            OuterClass.InnerClass.class,
            new DefaultPersistenceDelegate() {
                protected Expression instantiate(Object oldInstance, Encoder out) {
                    OuterClass.InnerClass inner = (OuterClass.InnerClass) oldInstance;
                    OuterClass outer = inner.getOuter();
                    return new Expression(inner, outer, "getInner", new Object[0]);
                }
            }
    );
}
Test4679556.java 文件源码 项目:openjdk9 阅读 22 收藏 0 点赞 0 评论 0
protected void initialize(XMLEncoder encoder) {
    encoder.setPersistenceDelegate(C.class, new DefaultPersistenceDelegate() {
        protected Expression instantiate(Object oldInstance, Encoder out) {
            C c = (C) oldInstance;
            return new Expression(c, c.getX(), "createC", new Object[] {});
        }
    });
}
TestPersistenceDelegate.java 文件源码 项目:jdk8u_jdk 阅读 25 收藏 0 点赞 0 评论 0
public static void main(String[] args) throws InterruptedException {
    Class<?> type = TestPersistenceDelegate.class;
    test(type, DefaultPersistenceDelegate.class);
    ENCODER.setPersistenceDelegate(type, new BeanPersistenceDelegate());
    test(type, BeanPersistenceDelegate.class);
    ENCODER.setPersistenceDelegate(type, null);
    test(type, DefaultPersistenceDelegate.class);
    // the following tests fails on previous build
    test(Bean.class, BeanPersistenceDelegate.class);
    test(BeanPersistenceDelegate.class, BeanPersistenceDelegate.class);
}
Test4936682.java 文件源码 项目:jdk8u_jdk 阅读 27 收藏 0 点赞 0 评论 0
protected void initialize(XMLEncoder encoder) {
    encoder.setPersistenceDelegate(
            OuterClass.InnerClass.class,
            new DefaultPersistenceDelegate() {
                protected Expression instantiate(Object oldInstance, Encoder out) {
                    OuterClass.InnerClass inner = (OuterClass.InnerClass) oldInstance;
                    OuterClass outer = inner.getOuter();
                    return new Expression(inner, outer, "getInner", new Object[0]);
                }
            }
    );
}


问题


面经


文章

微信
公众号

扫码关注公众号