Package net.hasor.rsf.serialize

Examples of net.hasor.rsf.serialize.Decoder


    }
    //
    /**将请求参数转换为对象。*/
    public Object[] toParameters(SerializeFactory serializeFactory) throws Throwable {
        String codeName = this.getSerializeType();
        Decoder decoder = serializeFactory.getDecoder(codeName);
        //
        String[] paramTypes = this.getParameterTypes();
        Object[] paramObject = new Object[paramTypes.length];
        //
        if (decoder == null && (paramTypes.length > 0)) {
            throw new RsfException(ProtocolStatus.SerializeError,//
                    "Undefined ‘" + codeName + "’ serialize decoder ");
        }
        //
        for (int i = 0; i < paramTypes.length; i++) {
            byte[] paramData = this.paramDatas.get(i);
            paramObject[i] = decoder.decode(paramData);
        }
        return paramObject;
    }
View Full Code Here


        return this.returnData;
    }
    /**获取要返回的值*/
    public Object getReturnData(SerializeFactory serializeFactory) throws Throwable {
        String codeName = this.getSerializeType();
        Decoder decoder = serializeFactory.getDecoder(codeName);
        //
        if (decoder == null && this.returnData != null)
            throw new UndefinedException("Undefined ‘" + codeName + "’ serialize decoder ");
        //
        return decoder.decode(this.returnData);
    }
View Full Code Here

TOP

Related Classes of net.hasor.rsf.serialize.Decoder

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.