public InfoMethod(final MethodOperator method, final ParameterSetCombination combination) { this.method = method; syntax = method.toUriLiteral(); minParameter = 1; maxParameter = 1; this.combination = combination; }
private void createMethodNode(MethodOperator methodCall, int size) throws ODataApplicationException { List<FilterNodeInternal> tempParamList = new ArrayList(); for (int i = size; i > 0; i--) tempParamList.add(tempStack.pop()); Collections.reverse(tempParamList); tempStack.push(new FunctionNodeImpl(methodCall.name().toString(), tempParamList, new NodeInfoImpl(methodCall.name().toString(), NODE_KIND.FUNCTION))); } }
public InfoMethod(final MethodOperator method, final int minParameters, final int maxParameters, final ParameterSetCombination combination) { this.method = method; syntax = method.toUriLiteral(); minParameter = minParameters; maxParameter = maxParameters; this.combination = combination; }
public InfoMethod(final MethodOperator method, final int minParameters, final int maxParameters, final ParameterSetCombination combination) { this.method = method; syntax = method.toUriLiteral(); minParameter = minParameters; maxParameter = maxParameters; this.combination = combination; }
public InfoMethod(final MethodOperator method, final ParameterSetCombination combination) { this.method = method; syntax = method.toUriLiteral(); minParameter = 1; maxParameter = 1; this.combination = combination; }
public InfoMethod(final MethodOperator method, final ParameterSetCombination combination) { this.method = method; syntax = method.toUriLiteral(); minParameter = 1; maxParameter = 1; this.combination = combination; }
public InfoMethod(final MethodOperator method, final int minParameters, final int maxParameters, final ParameterSetCombination combination) { this.method = method; syntax = method.toUriLiteral(); minParameter = minParameters; maxParameter = maxParameters; this.combination = combination; }
public static ExpressionParserException createMETHOD_WRONG_INPUT_TYPE(final MethodExpressionImpl methodExpression, final Token token, final String expression) { MessageReference msgRef = null; // Tested with TestParserExceptions.TestPMreadParameters CASE 7-1 msgRef = ExpressionParserException.METHOD_WRONG_INPUT_TYPE.create(); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); return new ExpressionParserException(msgRef); }
public static ExpressionParserException createMETHOD_WRONG_INPUT_TYPE(final MethodExpressionImpl methodExpression, final Token token, final String expression) { MessageReference msgRef = null; // Tested with TestParserExceptions.TestPMreadParameters CASE 7-1 msgRef = ExpressionParserException.METHOD_WRONG_INPUT_TYPE.create(); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); return new ExpressionParserException(msgRef); }
public static ExpressionParserException createMETHOD_WRONG_INPUT_TYPE(final MethodExpressionImpl methodExpression, final Token token, final String expression) { MessageReference msgRef = null; // Tested with TestParserExceptions.TestPMreadParameters CASE 7-1 msgRef = ExpressionParserException.METHOD_WRONG_INPUT_TYPE.create(); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); return new ExpressionParserException(msgRef); }
@Override public Object visitMethod(final MethodExpression methodExpression, final MethodOperator method, final List<Object> parameters) { try { StringWriter writer = new StringWriter(); JsonStreamWriter jsonStreamWriter = new JsonStreamWriter(writer); jsonStreamWriter.beginObject().namedStringValueRaw("nodeType", methodExpression.getKind().toString()).separator() .namedStringValueRaw("operator", method.toUriLiteral()).separator().namedStringValueRaw("type", getType(methodExpression)).separator().name("parameters").beginArray(); boolean first = true; for (Object parameter : parameters) { if (first) { first = false; } else { jsonStreamWriter.separator(); } jsonStreamWriter.unquotedValue(parameter.toString()); } jsonStreamWriter.endArray().endObject(); writer.flush(); return writer.toString(); } catch (final IOException e) { return null; } }
@Override public Object visitMethod(final MethodExpression methodExpression, final MethodOperator method, final List<Object> parameters) { try { StringWriter writer = new StringWriter(); JsonStreamWriter jsonStreamWriter = new JsonStreamWriter(writer); jsonStreamWriter.beginObject().namedStringValueRaw("nodeType", methodExpression.getKind().toString()).separator() .namedStringValueRaw("operator", method.toUriLiteral()).separator().namedStringValueRaw("type", getType(methodExpression)).separator().name("parameters").beginArray(); boolean first = true; for (Object parameter : parameters) { if (first) { first = false; } else { jsonStreamWriter.separator(); } jsonStreamWriter.unquotedValue(parameter.toString()); } jsonStreamWriter.endArray().endObject(); writer.flush(); return writer.toString(); } catch (final IOException e) { return null; } }
@Override public Object visitMethod(final MethodExpression methodExpression, final MethodOperator method, final List<Object> parameters) { try { StringWriter writer = new StringWriter(); JsonStreamWriter jsonStreamWriter = new JsonStreamWriter(writer); jsonStreamWriter.beginObject().namedStringValueRaw("nodeType", methodExpression.getKind().toString()).separator() .namedStringValueRaw("operator", method.toUriLiteral()).separator().namedStringValueRaw("type", getType(methodExpression)).separator().name("parameters").beginArray(); boolean first = true; for (Object parameter : parameters) { if (first) { first = false; } else { jsonStreamWriter.separator(); } jsonStreamWriter.unquotedValue(parameter.toString()); } jsonStreamWriter.endArray().endObject(); writer.flush(); return writer.toString(); } catch (final IOException e) { return null; } }
msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression);
msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression);
msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); msgRef.addContent(methodExpression.getMethod().toUriLiteral()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression);
lAvailableMethods.put(MethodOperator.ENDSWITH.toUriLiteral(), new InfoMethod(MethodOperator.ENDSWITH, 2, 2, combination)); lAvailableMethods.put(MethodOperator.INDEXOF.toUriLiteral(), new InfoMethod(MethodOperator.INDEXOF, 2, 2, combination)); lAvailableMethods.put(MethodOperator.STARTSWITH.toUriLiteral(), new InfoMethod(MethodOperator.STARTSWITH, 2, 2, combination)); lAvailableMethods.put(MethodOperator.TOLOWER.toUriLiteral(), new InfoMethod(MethodOperator.TOLOWER, combination)); lAvailableMethods.put(MethodOperator.TOUPPER.toUriLiteral(), new InfoMethod(MethodOperator.TOUPPER, combination)); lAvailableMethods.put(MethodOperator.TRIM.toUriLiteral(), new InfoMethod(MethodOperator.TRIM, combination)); combination.add(new ParameterSet(string, string, int32)); combination.add(new ParameterSet(string, string, int32, int32)); lAvailableMethods.put(MethodOperator.SUBSTRING.toUriLiteral(), new InfoMethod(MethodOperator.SUBSTRING, 1, -1, combination)); lAvailableMethods.put(MethodOperator.SUBSTRINGOF.toUriLiteral(), new InfoMethod(MethodOperator.SUBSTRINGOF, 1, -1, combination)); lAvailableMethods.put(MethodOperator.CONCAT.toUriLiteral(), new InfoMethod(MethodOperator.CONCAT, 2, -1, combination)); lAvailableMethods.put(MethodOperator.LENGTH.toUriLiteral(), new InfoMethod(MethodOperator.LENGTH, combination)); lAvailableMethods.put(MethodOperator.YEAR.toUriLiteral(), new InfoMethod(MethodOperator.YEAR, combination));
lAvailableMethods.put(MethodOperator.ENDSWITH.toUriLiteral(), new InfoMethod(MethodOperator.ENDSWITH, 2, 2, combination)); lAvailableMethods.put(MethodOperator.INDEXOF.toUriLiteral(), new InfoMethod(MethodOperator.INDEXOF, 2, 2, combination)); lAvailableMethods.put(MethodOperator.STARTSWITH.toUriLiteral(), new InfoMethod(MethodOperator.STARTSWITH, 2, 2, combination)); lAvailableMethods.put(MethodOperator.TOLOWER.toUriLiteral(), new InfoMethod(MethodOperator.TOLOWER, combination)); lAvailableMethods.put(MethodOperator.TOUPPER.toUriLiteral(), new InfoMethod(MethodOperator.TOUPPER, combination)); lAvailableMethods.put(MethodOperator.TRIM.toUriLiteral(), new InfoMethod(MethodOperator.TRIM, combination)); combination.add(new ParameterSet(string, string, int32)); combination.add(new ParameterSet(string, string, int32, int32)); lAvailableMethods.put(MethodOperator.SUBSTRING.toUriLiteral(), new InfoMethod(MethodOperator.SUBSTRING, 1, -1, combination)); lAvailableMethods.put(MethodOperator.SUBSTRINGOF.toUriLiteral(), new InfoMethod(MethodOperator.SUBSTRINGOF, 1, -1, combination)); lAvailableMethods.put(MethodOperator.CONCAT.toUriLiteral(), new InfoMethod(MethodOperator.CONCAT, 2, -1, combination)); lAvailableMethods.put(MethodOperator.LENGTH.toUriLiteral(), new InfoMethod(MethodOperator.LENGTH, combination)); lAvailableMethods.put(MethodOperator.YEAR.toUriLiteral(), new InfoMethod(MethodOperator.YEAR, combination));
lAvailableMethods.put(MethodOperator.ENDSWITH.toUriLiteral(), new InfoMethod(MethodOperator.ENDSWITH, 2, 2, combination)); lAvailableMethods.put(MethodOperator.INDEXOF.toUriLiteral(), new InfoMethod(MethodOperator.INDEXOF, 2, 2, combination)); lAvailableMethods.put(MethodOperator.STARTSWITH.toUriLiteral(), new InfoMethod(MethodOperator.STARTSWITH, 2, 2, combination)); lAvailableMethods.put(MethodOperator.TOLOWER.toUriLiteral(), new InfoMethod(MethodOperator.TOLOWER, combination)); lAvailableMethods.put(MethodOperator.TOUPPER.toUriLiteral(), new InfoMethod(MethodOperator.TOUPPER, combination)); lAvailableMethods.put(MethodOperator.TRIM.toUriLiteral(), new InfoMethod(MethodOperator.TRIM, combination)); combination.add(new ParameterSet(string, string, int32)); combination.add(new ParameterSet(string, string, int32, int32)); lAvailableMethods.put(MethodOperator.SUBSTRING.toUriLiteral(), new InfoMethod(MethodOperator.SUBSTRING, 1, -1, combination)); lAvailableMethods.put(MethodOperator.SUBSTRINGOF.toUriLiteral(), new InfoMethod(MethodOperator.SUBSTRINGOF, 1, -1, combination)); lAvailableMethods.put(MethodOperator.CONCAT.toUriLiteral(), new InfoMethod(MethodOperator.CONCAT, 2, -1, combination)); lAvailableMethods.put(MethodOperator.LENGTH.toUriLiteral(), new InfoMethod(MethodOperator.LENGTH, combination)); lAvailableMethods.put(MethodOperator.YEAR.toUriLiteral(), new InfoMethod(MethodOperator.YEAR, combination));