/** * Create an inbound file variable. * Usually called by a query parser to setup a list of known variables. * This method also checks to see if the new variable is a parameter and if * it is it updates the count of parameters * @param callNum The call number to work on * @param key The name of the variable * @param type The javascript type of the variable * @param value The value of the file */ public void createInboundVariable(int callNum, String key, String type, FormField value) { InboundVariable iv = new InboundVariable(this, key, type, value); checkInboundVariable(callNum, key, iv); }
@Override protected Property createTypeHintContext(InboundContext inctx, Property property) { return inctx.getCurrentProperty(); }
Object converted = context.getConverted(data, paramType); if (converted == null) context.pushContext(thc); converted = converter.convertInbound(paramType, data); context.popContext();
public Calls convertToCalls(HttpServletRequest request) InboundContext inboundContext = new InboundContext(); String pathInfo = request.getPathInfo(); String[] pathParts = pathInfo.split("/"); ProtocolConstants.INBOUND_CALLNUM_SUFFIX + ProtocolConstants.INBOUND_KEY_PARAM + (i - 4); inboundContext.createInboundVariable(0, key, "string", pathParts[i]); ProtocolConstants.INBOUND_CALLNUM_SUFFIX + ProtocolConstants.INBOUND_KEY_PARAM + i; inboundContext.createInboundVariable(0, key, "string", values[0], true); i++; inboundContext.dereference(); InboundVariable param = inboundContext.getParameter(0, j); Property property = new ParameterProperty(method, j);
log.warn("Expected object while converting data for " + paramType.getName() + " in " + data.getContext().getCurrentProperty() + ". Passed: " + value); throw new ConversionException(paramType, "Data conversion error. See logs for more details."); data.getContext().addConverted(data, instanceType, bean); data.getContext().addConverted(data, paramType, bean);
inctx.dereference(); if (method.isVarArgs() && outboundArgIndex + 1 == destParamCount) param = inctx.createArrayWrapper(callNum, destParamCount); param = inctx.getParameter(callNum, inboundArgIndex);
InboundContext inboundContext = new InboundContext(); inboundContexts.add(inboundContext); if (formField.isFile()) inboundContext.createInboundVariable(callNum, key, ProtocolConstants.TYPE_FILE, formField); inboundContext.createInboundVariable(callNum, key, type, value);
data.getContext().addConverted(data, instanceType, bean); data.getContext().addConverted(data, paramType, bean);
public Object convertInbound(@SuppressWarnings("rawtypes") Class paramType, InboundVariable iv, InboundContext inctx, TypeHintContext incc) throws MarshallException { Object converted = inctx.getConverted(iv, paramType); if (converted == null) { // Was the inbound variable marshalled as an Object in the client // (could mean that this is an instance of one of our generated // JavaScript classes) Converter converter = getNamedConverter(paramType, iv.getType()); // Fall back to the standard way of locating a converter if we // didn't find anything above if (converter == null) { converter = getConverter(paramType); } if (converter == null) { throw new MarshallException(paramType, Messages.getString("DefaultConverterManager.MissingConverter", paramType)); } // We only think about doing a null conversion ourselves once we are // sure that there is a converter available. This prevents hackers // from passing null to things they are not allowed to convert if (iv.isNull()) { return null; } inctx.pushContext(incc); converted = converter.convertInbound(paramType, iv, inctx); inctx.popContext(); } return converted; }
data.getContext().addConverted(data, paramType, array); Object output = converterManager.convertInbound(componentType, members[i], data.getContext().getCurrentProperty()); Array.set(array, i, output); data.getContext().addConverted(data, paramType, array); Object output = converterManager.convertInbound(componentType, nested, data.getContext().getCurrentProperty()); Array.set(array, i, output);
log.warn("Expected collection while converting data for " + paramType.getName() + " in " + data.getContext().getCurrentProperty() + ". Passed: " + value); throw new ConversionException(paramType, "Data conversion error. See logs for more details."); Property parent = data.getContext().getCurrentProperty(); Property child = parent.createChild(0); child = converterManager.checkOverride(child); data.getContext().addConverted(data, paramType, col);
/** * Create an inbound variable. * Usually called by a query parser to setup a list of known variables. * This method also checks to see if the new variable is a parameter and if * it is it updates the count of parameters * @param callNum The call number to work on * @param key The name of the variable * @param type The javascript type of the variable * @param value The value of the variable * @param has value been URL decoded? */ public void createInboundVariable(int callNum, String key, String type, String value, boolean urlDecoded) { InboundVariable cte = new InboundVariable(this, key, type, value, urlDecoded); checkInboundVariable(callNum, key, cte); }
log.warn("Expected object while converting data for " + paramType.getName() + " in " + data.getContext().getCurrentProperty() + ". Passed: " + value); throw new ConversionException(paramType, "Data conversion error. See logs for more details.");
log.warn("Expected object while converting data for " + paramType.getName() + " in " + data.getContext().getCurrentProperty() + ". Passed: " + value); throw new ConversionException(paramType, "Data conversion error. See logs for more details."); Property parent = data.getContext().getCurrentProperty(); data.getContext().addConverted(data, paramType, map); InboundContext incx = data.getContext();
/** * Create an inbound variable. * Usually called by a query parser to setup a list of known variables. * This method also checks to see if the new variable is a parameter and if * it is it updates the count of parameters * @param callNum The call number to work on * @param key The name of the variable * @param type The javascript type of the variable * @param value The value of the variable */ public void createInboundVariable(int callNum, String key, String type, String value) { InboundVariable cte = new InboundVariable(this, key, type, value); checkInboundVariable(callNum, key, cte); }