/** * 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); }
/** * 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); }
/** * 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); }
/** * This is very nasty - we need to create an array for varargs. The correct * solution is to have ArrayConverter (and MapConverter) part of dwrp and * not implementations of Converter. This would resolve a number of problems * however for now we will have to create a mock InboundVariable to make it * look to our ArrayConverter that the client passed in an array all along * @param callNum The call number to work on * @param destParamCount The number of parameters to the method that we are * calling, from which we can work out the size of the varargs array */ public InboundVariable createArrayWrapper(int callNum, int destParamCount) { int inputParamCount = getParameterCount(callNum); int varArgArraySize = 1 + inputParamCount - destParamCount; InboundVariable[] members = new InboundVariable[varArgArraySize]; int varArgsParamStartIndex = destParamCount - 1; // The varargs param has to be last for (int i = 0; i < varArgArraySize; i++) { members[i] = getParameter(callNum, varArgsParamStartIndex); varArgsParamStartIndex++; } return new InboundVariable(this, members); }
protected <T> T getValue( String name, Class<T> type, InboundVariable data, Map<String, String> tokens, InboundContext inctx) throws MarshallException { final T value; final String valueString = tokens.get(name); if (valueString != null) { final String[] split = ParseUtil.splitInbound(valueString); final String splitValue = split[LocalUtil.INBOUND_INDEX_VALUE]; final String splitType = split[LocalUtil.INBOUND_INDEX_TYPE]; final InboundVariable nested = new InboundVariable( data.getLookup(), null, splitType, splitValue); @SuppressWarnings("unchecked") final T valueDraft = (T) getConverterManager().convertInbound(type, nested, inctx, null); value = valueDraft; } else { value = null; } return value; }
/** * We have inbound data and a type that we need to convert it into, this * method performs the conversion. */ protected Object convert(String val, Class<?> propType, InboundContext inboundContext, Property property) { String[] split = ConvertUtil.splitInbound(val); String splitValue = split[ConvertUtil.INBOUND_INDEX_VALUE]; String splitType = split[ConvertUtil.INBOUND_INDEX_TYPE]; InboundVariable nested = new InboundVariable(inboundContext, null, splitType, splitValue); nested.dereference(); Property incc = createTypeHintContext(inboundContext, property); return converterManager.convertInbound(propType, nested, incc); }
String splitValue = split[ConvertUtil.INBOUND_INDEX_VALUE]; InboundVariable nested = new InboundVariable(data.getContext(), null, splitType, splitValue); nested.dereference();
String splitValue = split[ConvertUtil.INBOUND_INDEX_VALUE]; InboundVariable nested = new InboundVariable(incx, null, splitType, splitValue); nested.dereference(); Object output = converterManager.convertInbound(componentType, nested, data.getContext().getCurrentProperty());
@Override protected Object convertInbound( @SuppressWarnings({ "rawtypes" }) Class paramType, InboundVariable data, Map<String, String> tokens, InboundContext inctx, String value) throws MarshallException { final String coordinatesString = tokens.get("coordinates"); //$NON-NLS-1$ final String[] split = ParseUtil.splitInbound(coordinatesString); final String splitValue = split[LocalUtil.INBOUND_INDEX_VALUE]; final String splitType = split[LocalUtil.INBOUND_INDEX_TYPE]; final InboundVariable nested = new InboundVariable( data.getLookup(), null, splitType, splitValue); @SuppressWarnings("unchecked") final C coordinates = (C) getConverterManager().convertInbound( getCoordinatesType(), nested, inctx, null); return createGeometry(coordinates); }
String splitIvValue = splitIv[ConvertUtil.INBOUND_INDEX_VALUE]; String splitIvType = splitIv[ConvertUtil.INBOUND_INDEX_TYPE]; InboundVariable valIv = new InboundVariable(incx, null, splitIvType, splitIvValue); valIv.dereference(); Object val = converterManager.convertInbound(valType, valIv, valProp); InboundVariable keyIv = new InboundVariable(incx, null, ProtocolConstants.TYPE_STRING, keyStr); keyIv.dereference();
@Override protected Object convertInbound( @SuppressWarnings({ "rawtypes" }) Class paramType, InboundVariable data, Map<String, String> tokens, InboundContext inctx, String value) throws MarshallException { final String coordinatesString = tokens.get("coordinates"); //$NON-NLS-1$ final String[] split = ParseUtil.splitInbound(coordinatesString); final String splitValue = split[LocalUtil.INBOUND_INDEX_VALUE]; final String splitType = split[LocalUtil.INBOUND_INDEX_TYPE]; final InboundVariable nested = new InboundVariable( data.getLookup(), null, splitType, splitValue); @SuppressWarnings("unchecked") final C coordinates = (C) getConverterManager().convertInbound( getCoordinatesType(), nested, inctx, null); return createGeometry(coordinates); }
String splitType = split[LocalUtil.INBOUND_INDEX_TYPE]; InboundVariable nested = new InboundVariable(data.getLookup(), null, splitType, splitValue);