Package com.alibaba.fastjson.parser

Examples of com.alibaba.fastjson.parser.ParserConfig


        mapping.setAsmEnable(false);

        String text = JSON.toJSONString(v, mapping, SerializerFeature.WriteMapNullValue);
        Assert.assertEquals("{\"value\":null}", text);

        ParserConfig config = new ParserConfig();
        config.setAsmEnable(false);
       
        V0 v1 = JSON.parseObject(text, V0.class, config, JSON.DEFAULT_PARSER_FEATURE);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
View Full Code Here


   
    public void test_create_2() throws Exception {
        Entity entity = new Entity(123, "菜姐");
        String text = JSON.toJSONString(entity);
       
        ParserConfig config = new ParserConfig();
        config.setAsmEnable(false);
       
        Entity entity2 = JSON.parseObject(text, Entity.class, config, 0);
        Assert.assertEquals(entity.getId(), entity2.getId());
        Assert.assertEquals(entity.getName(), entity2.getName());
    }
View Full Code Here

        mapping.setAsmEnable(false);

        String text = JSON.toJSONString(v, mapping, SerializerFeature.WriteMapNullValue);
        Assert.assertEquals("{\"value\":null}", text);

        ParserConfig config = new ParserConfig();
        config.setAsmEnable(false);
       
        V0 v1 = JSON.parseObject(text, V0.class, config, JSON.DEFAULT_PARSER_FEATURE);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
View Full Code Here

        mapping.setAsmEnable(false);

        String text = JSON.toJSONString(v, mapping, SerializerFeature.WriteMapNullValue);
        Assert.assertEquals("{\"value\":null}", text);

        ParserConfig config = new ParserConfig();
        config.setAsmEnable(false);
       
        V0 v1 = JSON.parseObject(text, V0.class, config, JSON.DEFAULT_PARSER_FEATURE);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
View Full Code Here

   
    public void test_create_2() throws Exception {
        Entity entity = new Entity(123, "菜姐");
        String text = JSON.toJSONString(entity);
       
        ParserConfig config = new ParserConfig();
        config.setAsmEnable(false);
       
        Entity entity2 = JSON.parseObject(text, Entity.class, config, 0);
        Assert.assertEquals(entity.getId(), entity2.getId());
        Assert.assertEquals(entity.getName(), entity2.getName());
    }
View Full Code Here

        mapping.setAsmEnable(true);

        String text = JSON.toJSONString(v, mapping, SerializerFeature.WriteMapNullValue);
        Assert.assertEquals("{\"value\":null}", text);

        ParserConfig config = new ParserConfig();
        config.setAsmEnable(false);
       
        V0 v1 = JSON.parseObject(text, V0.class, config, JSON.DEFAULT_PARSER_FEATURE);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
View Full Code Here

    }

    public void test_7() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("123");

        ParserConfig mapping = new ParserConfig();
        parser.setConfig(mapping);
        Assert.assertEquals(mapping, parser.getConfig());
    }
View Full Code Here

import com.alibaba.fastjson.serializer.ReferenceCodec;

public class ReferenceDeserializerTest extends TestCase {

    public void test_0() throws Exception {
        ParserConfig config = new ParserConfig();
        config.putDeserializer(MyRef.class, ReferenceCodec.instance);
        Exception error = null;
        try {
            JSON.parseObject("{\"ref\":{}}", VO.class, config, 0);
        } catch (Exception ex) {
            error = ex;
View Full Code Here

    String text = JSON.toJSONString(v, mapping,
        SerializerFeature.WriteMapNullValue);
    Assert.assertEquals("{\"value\":123}", text);

    ParserConfig config = new ParserConfig();
    config.setAsmEnable(false);

    V0 v1 = JSON.parseObject(text, V0.class, config,
        JSON.DEFAULT_PARSER_FEATURE);

    Assert.assertEquals(v1.getValue(), v.getValue());
View Full Code Here

import com.alibaba.fastjson.parser.ParserConfig;

public class ParserConfigTest extends TestCase {

    public void test_0() throws Exception {
        ParserConfig config = new ParserConfig();
        config.getDerializers();
    }
View Full Code Here

TOP

Related Classes of com.alibaba.fastjson.parser.ParserConfig

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.