@Override public MethodOperator getMethod() { return infoMethod.getMethod(); }
public MethodExpressionImpl(final InfoMethod infoMethod) { this.infoMethod = infoMethod; returnType = infoMethod.getReturnType(); actualParameters = new ArrayList<CommonExpression>(); }
@Override public String getUriLiteral() { return infoMethod.getSyntax(); }
if ((methodInfo.getMinParameter() > -1) && (count < methodInfo.getMinParameter())) { if ((methodInfo.getMaxParameter() > -1) && (count > methodInfo.getMaxParameter())) {
protected void validateMethodTypes(final MethodExpression methodExpression, final Token methodToken) throws ExpressionParserException, ExpressionParserInternalError { InfoMethod methOpt = availableMethods.get(methodExpression.getUriLiteral()); List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); // If there are no parameter then don't perform a type check if (methodExpression.getParameters().isEmpty()) { return; } for (CommonExpression parameter : methodExpression.getParameters()) { // If there is not at parsing time its not possible to determine the type of eg myPropertyName. // Since this should not cause validation errors null type node arguments are leading to bypass // the validation if (parameter.getEdmType() == null && resourceEntityType == null) { return; } actualParameterTypes.add(parameter.getEdmType()); } ParameterSet parameterSet = methOpt.validateParameterSet(actualParameterTypes); // If there is not returntype then the input parameter if (parameterSet == null) { // Tested with TestParserExceptions.testPMvalidateMethodTypes CASE 1 throw FilterParserExceptionImpl.createMETHOD_WRONG_INPUT_TYPE((MethodExpressionImpl) methodExpression, methodToken, curExpression); } methodExpression.setEdmType(parameterSet.getReturnType()); }
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));
if ((methodInfo.getMinParameter() > -1) && (count < methodInfo.getMinParameter())) { if ((methodInfo.getMaxParameter() > -1) && (count > methodInfo.getMaxParameter())) {
protected void validateMethodTypes(final MethodExpression methodExpression, final Token methodToken) throws ExpressionParserException, ExpressionParserInternalError { InfoMethod methOpt = availableMethods.get(methodExpression.getUriLiteral()); List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); // If there are no parameter then don't perform a type check if (methodExpression.getParameters().isEmpty()) { return; } for (CommonExpression parameter : methodExpression.getParameters()) { // If there is not at parsing time its not possible to determine the type of eg myPropertyName. // Since this should not cause validation errors null type node arguments are leading to bypass // the validation if (parameter.getEdmType() == null && resourceEntityType == null) { return; } actualParameterTypes.add(parameter.getEdmType()); } ParameterSet parameterSet = methOpt.validateParameterSet(actualParameterTypes); // If there is not returntype then the input parameter if (parameterSet == null) { // Tested with TestParserExceptions.testPMvalidateMethodTypes CASE 1 throw FilterParserExceptionImpl.createMETHOD_WRONG_INPUT_TYPE((MethodExpressionImpl) methodExpression, methodToken, curExpression); } methodExpression.setEdmType(parameterSet.getReturnType()); }
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));
if ((methodInfo.getMinParameter() > -1) && (count < methodInfo.getMinParameter())) { if ((methodInfo.getMaxParameter() > -1) && (count > methodInfo.getMaxParameter())) {
public MethodExpressionImpl(final InfoMethod infoMethod) { this.infoMethod = infoMethod; returnType = infoMethod.getReturnType(); actualParameters = new ArrayList<CommonExpression>(); }
@Override public String getUriLiteral() { return infoMethod.getSyntax(); }
@Override public MethodOperator getMethod() { return infoMethod.getMethod(); }
protected void validateMethodTypes(final MethodExpression methodExpression, final Token methodToken) throws ExpressionParserException, ExpressionParserInternalError { InfoMethod methOpt = availableMethods.get(methodExpression.getUriLiteral()); List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); // If there are no parameter then don't perform a type check if (methodExpression.getParameters().size() == 0) { return; } for (CommonExpression parameter : methodExpression.getParameters()) { // If there is not at parsing time its not possible to determine the type of eg myPropertyName. // Since this should not cause validation errors null type node arguments are leading to bypass // the validation if ((parameter.getEdmType() == null) && (resourceEntityType == null)) { return; } actualParameterTypes.add(parameter.getEdmType()); } ParameterSet parameterSet = methOpt.validateParameterSet(actualParameterTypes); // If there is not returntype then the input parameter if (parameterSet == null) { // Tested with TestParserExceptions.testPMvalidateMethodTypes CASE 1 throw FilterParserExceptionImpl.createMETHOD_WRONG_INPUT_TYPE((MethodExpressionImpl) methodExpression, methodToken, curExpression); } methodExpression.setEdmType(parameterSet.getReturnType()); }
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));
public static ExpressionParserException createMETHOD_WRONG_ARG_COUNT(final MethodExpressionImpl methodExpression, final Token token, final String expression) { MessageReference msgRef = null; int minParam = methodExpression.getMethodInfo().getMinParameter(); int maxParam = methodExpression.getMethodInfo().getMaxParameter();
public MethodExpressionImpl(final InfoMethod infoMethod) { this.infoMethod = infoMethod; returnType = infoMethod.getReturnType(); actualParameters = new ArrayList<CommonExpression>(); }
@Override public String getUriLiteral() { return infoMethod.getSyntax(); }
@Override public MethodOperator getMethod() { return infoMethod.getMethod(); }
public static ExpressionParserException createMETHOD_WRONG_ARG_COUNT(final MethodExpressionImpl methodExpression, final Token token, final String expression) { MessageReference msgRef = null; int minParam = methodExpression.getMethodInfo().getMinParameter(); int maxParam = methodExpression.getMethodInfo().getMaxParameter();