Examples of BeforeFilter


Examples of com.alibaba.fastjson.serializer.BeforeFilter

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.BeforeFilter;

public class BeforeFilterTest extends TestCase {
    public void test_beforeFilter() throws Exception {
        BeforeFilter filter = new BeforeFilter() {
           
            @Override
            public void writeBefore(Object object) {
                this.writeKeyValue("id", 123);
            }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.BeforeFilter

        };
        Assert.assertEquals("{\"id\":123}",JSON.toJSONString( new VO(), filter));
    }
   
    public void test_beforeFilter2() throws Exception {
        BeforeFilter filter = new BeforeFilter() {
           
            @Override
            public void writeBefore(Object object) {
                this.writeKeyValue("id", 123);
                this.writeKeyValue("name", "wenshao");
View Full Code Here

Examples of com.alibaba.fastjson.serializer.BeforeFilter

import com.alibaba.fastjson.serializer.BeforeFilter;

public class BeforeFilterTest3 extends TestCase {

    public void test_beforeFilter() throws Exception {
        BeforeFilter filter = new BeforeFilter() {

            @Override
            public void writeBefore(Object object) {
                this.writeKeyValue("id", 123);
            }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.BeforeFilter

        };
        Assert.assertEquals(JSON.toJSONString(new VO(), filter), "{\"id\":123,\"value\":1001}");
    }

    public void test_beforeFilter2() throws Exception {
        BeforeFilter filter = new BeforeFilter() {

            @Override
            public void writeBefore(Object object) {
                this.writeKeyValue("id", 123);
                this.writeKeyValue("name", "wenshao");
View Full Code Here

Examples of com.alibaba.fastjson.serializer.BeforeFilter

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.BeforeFilter;

public class BeforeFilterTest2 extends TestCase {
    public void test_beforeFilter() throws Exception {
        BeforeFilter filter = new BeforeFilter() {
           
            @Override
            public void writeBefore(Object object) {
                this.writeKeyValue("id", 123);
            }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.BeforeFilter

        };
        Assert.assertEquals(JSON.toJSONString(new VO(), filter), "{\"id\":123}");
    }
   
    public void test_beforeFilter2() throws Exception {
        BeforeFilter filter = new BeforeFilter() {
           
            @Override
            public void writeBefore(Object object) {
                this.writeKeyValue("id", 123);
                this.writeKeyValue("name", "wenshao");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.