Package com.alibaba.fastjson.serializer

Examples of com.alibaba.fastjson.serializer.SimplePropertyPreFilter


        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class);
        Assert.assertEquals("{\"id\":123,\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
   
    public void test_all_map() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class);
        Assert.assertEquals("{\"id\":123,\"name\":\"sandzhangtoo\"}", JSON.toJSONString(map, filter));
    }
View Full Code Here


        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class);
        Assert.assertEquals("{\"id\":123,\"name\":\"sandzhangtoo\"}", JSON.toJSONString(map, filter));
    }
   
    public void test_exclude_id() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class);
        filter.getExcludes().add("id");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
View Full Code Here

        filter.getExcludes().add("id");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
   
    public void test_exclude_id_map() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class);
        filter.getExcludes().add("id");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
View Full Code Here

        filter.getExcludes().add("id");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
   
    public void test_exclude_name() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class);
        filter.getExcludes().add("name");
        Assert.assertEquals("{\"id\":123}", JSON.toJSONString(vo, filter));
    }
View Full Code Here

        map.put("name", "sandzhangtoo");
        map.put(null, null);
    }

    public void test_name() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class, "name");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
View Full Code Here

        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class, "name");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
   
    public void test_name_0() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter("name");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
View Full Code Here

        SimplePropertyPreFilter filter = new SimplePropertyPreFilter("name");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(vo, filter));
    }
   
    public void test_name_a() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class, "name");
        Assert.assertEquals(VO.class, filter.getClazz());
        Assert.assertEquals(1, filter.getIncludes().size());
        Assert.assertTrue(filter.apply(null, null, null));
       
        String text = JSON.toJSONString(a, filter);
        Assert.assertTrue("{\"id\":123,\"name\":\"sandzhangtoo\"}".equals(text) || "{\"name\":\"sandzhangtoo\",\"id\":123}".equals(text));
    }
View Full Code Here

        String text = JSON.toJSONString(a, filter);
        Assert.assertTrue("{\"id\":123,\"name\":\"sandzhangtoo\"}".equals(text) || "{\"name\":\"sandzhangtoo\",\"id\":123}".equals(text));
    }
   
    public void test_name_a1() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter("name");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(a, filter));
    }
View Full Code Here

        SimplePropertyPreFilter filter = new SimplePropertyPreFilter("name");
        Assert.assertEquals("{\"name\":\"sandzhangtoo\"}", JSON.toJSONString(a, filter));
    }
   
    public void test_id() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class, "id");
        Assert.assertEquals("{\"id\":123}", JSON.toJSONString(vo, filter));
    }
View Full Code Here

        SimplePropertyPreFilter filter = new SimplePropertyPreFilter(VO.class, "id");
        Assert.assertEquals("{\"id\":123}", JSON.toJSONString(vo, filter));
    }
   
    public void test_id_0() throws Exception {
        SimplePropertyPreFilter filter = new SimplePropertyPreFilter("id");
        Assert.assertEquals("{\"id\":123}", JSON.toJSONString(vo, filter));
    }
View Full Code Here

TOP

Related Classes of com.alibaba.fastjson.serializer.SimplePropertyPreFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.