Package com.alibaba.fastjson.serializer

Examples of com.alibaba.fastjson.serializer.ObjectSerializer


public class ErrorTest extends TestCase {

    public void test_error() throws Exception {
        SerializeConfig config = new SerializeConfig();
        config.put(A.class, new ObjectSerializer() {

            public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features)
                                                                                                         throws IOException {
                throw new IOException();
            }
View Full Code Here


    }

    protected JavaBeanSerializer getJavaBeanSerializer(final Class<?> currentClass) {
        JavaBeanSerializer beanSerializer = null;
        {
            ObjectSerializer serializer = serializeConfig.getObjectWriter(currentClass);
            if (serializer instanceof JavaBeanSerializer) {
                beanSerializer = (JavaBeanSerializer) serializer;
            } else if (serializer instanceof ASMJavaBeanSerializer) {
                beanSerializer = ((ASMJavaBeanSerializer) serializer).getJavaBeanSerializer();
            }
View Full Code Here

TOP

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

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.