Package com.alibaba.fastjson.serializer

Examples of com.alibaba.fastjson.serializer.SerialContext


import com.alibaba.fastjson.serializer.SerialContext;


public class SerialContextTest extends TestCase {
    public void test_context() throws Exception {
        SerialContext root = new SerialContext(null, null, null);
        SerialContext context = new SerialContext(root, null, "x");
        Assert.assertEquals("x", context.getFieldName());
        Assert.assertEquals("$.x", context.toString());
    }
View Full Code Here


          return true;
      return false;
    }

    public boolean apply(JSONSerializer serializer, Object source, String name) {
      SerialContext nowContext = new SerialContext(serializer.getContext(), source, name);
      String nowPath = getLinkedPath(nowContext);
      System.out.println("path->" + nowPath);
      //只输出children.id
      return containInclude(onlyProperties, nowPath);
    }
View Full Code Here

          return true;
      return false;
    }

    public boolean apply(JSONSerializer serializer, Object source, String name) {
      SerialContext nowContext = new SerialContext(serializer.getContext(), source, name, 0, 0);
      String nowPath = getLinkedPath(nowContext);
      System.out.println("path->" + nowPath);
      //只输出children.id
      return containInclude(onlyProperties, nowPath);
    }
View Full Code Here

import com.alibaba.fastjson.serializer.SerialContext;


public class SerialContextTest extends TestCase {
    public void test_context() throws Exception {
        SerialContext root = new SerialContext(null, null, null, 0, 0);
        SerialContext context = new SerialContext(root, null, "x", 0, 0);
        Assert.assertEquals("x", context.getFieldName());
        Assert.assertEquals("$.x", context.toString());
    }
View Full Code Here

TOP

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

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.