org.directwebremoting.jsonrpc.io.JsonRpcCallsJsonDecoder Maven / Gradle / Ivy
package org.directwebremoting.jsonrpc.io;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.directwebremoting.extend.Call;
import org.directwebremoting.extend.ConverterManager;
import org.directwebremoting.extend.MethodDeclaration;
import org.directwebremoting.extend.Module;
import org.directwebremoting.extend.ModuleManager;
import org.directwebremoting.json.parse.JsonParseException;
import org.directwebremoting.json.parse.impl.StatefulJsonDecoder;
import org.directwebremoting.util.JavascriptUtil;
import static javax.servlet.http.HttpServletResponse.*;
import static org.directwebremoting.jsonrpc.JsonRpcConstants.*;
/**
* A JsonDecoder that creates a JsonRpcCalls structure.
* @author Joe Walker [joe at getahead dot ltd dot uk]
*/
public class JsonRpcCallsJsonDecoder extends StatefulJsonDecoder
{
/**
* Force creators to give us the beans we need
* @param converterManager ...
* @param moduleManager ...
*/
public JsonRpcCallsJsonDecoder(ConverterManager converterManager, ModuleManager moduleManager)
{
this.converterManager = converterManager;
this.moduleManager = moduleManager;
}
@Override
protected void addMemberToArray(Object parent, Object member) throws JsonParseException
{
if (!inParams)
{
log.error("JSON parse has addMemberToArray where inParms=false");
calls.addParseError("Array not expected");
return;
}
@SuppressWarnings("unchecked")
List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy