public MemberExpressionImpl(final CommonExpression path, final CommonExpression property) { this.path = path; this.property = property; edmType = property.getEdmType(); }
public MemberExpressionImpl(final CommonExpression path, final CommonExpression property) { this.path = path; this.property = property; edmType = property.getEdmType(); }
public MemberExpressionImpl(final CommonExpression path, final CommonExpression property) { this.path = path; this.property = property; edmType = property.getEdmType(); }
private static String getType(final CommonExpression expression) { try { final EdmType type = expression.getEdmType(); return type == null ? null : type.getNamespace() + Edm.DELIMITER + type.getName(); } catch (final EdmException e) { return "EdmException occurred: " + e.getMessage(); } } }
private static String getType(final CommonExpression expression) { try { final EdmType type = expression.getEdmType(); return type == null ? null : type.getNamespace() + Edm.DELIMITER + type.getName(); } catch (final EdmException e) { return "EdmException occurred: " + e.getMessage(); } } }
private static String getType(final CommonExpression expression) { try { final EdmType type = expression.getEdmType(); return type == null ? null : type.getNamespace() + Edm.DELIMITER + type.getName(); } catch (final EdmException e) { return "EdmException occurred: " + e.getMessage(); } } }
protected void validateUnaryOperatorTypes(final UnaryExpression unaryExpression) throws ExpressionParserInternalError { InfoUnaryOperator unOpt = availableUnaryOperators.get(unaryExpression.getOperator().toUriLiteral()); EdmType operandType = unaryExpression.getOperand().getEdmType(); if ((operandType == null) && (resourceEntityType == null)) { return; } List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); actualParameterTypes.add(operandType); ParameterSet parameterSet = unOpt.validateParameterSet(actualParameterTypes); if (parameterSet != null) { unaryExpression.setEdmType(parameterSet.getReturnType()); } }
protected void validateUnaryOperatorTypes(final UnaryExpression unaryExpression) throws ExpressionParserInternalError { InfoUnaryOperator unOpt = availableUnaryOperators.get(unaryExpression.getOperator().toUriLiteral()); EdmType operandType = unaryExpression.getOperand().getEdmType(); if ((operandType == null) && (resourceEntityType == null)) { return; } List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); actualParameterTypes.add(operandType); ParameterSet parameterSet = unOpt.validateParameterSet(actualParameterTypes); if (parameterSet != null) { unaryExpression.setEdmType(parameterSet.getReturnType()); } }
protected void validateUnaryOperatorTypes(final UnaryExpression unaryExpression) throws ExpressionParserInternalError { InfoUnaryOperator unOpt = availableUnaryOperators.get(unaryExpression.getOperator().toUriLiteral()); EdmType operandType = unaryExpression.getOperand().getEdmType(); if ((operandType == null) && (resourceEntityType == null)) { return; } List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); actualParameterTypes.add(operandType); ParameterSet parameterSet = unOpt.validateParameterSet(actualParameterTypes); if (parameterSet != null) { unaryExpression.setEdmType(parameterSet.getReturnType()); } }
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()); }
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()); }
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()); }
protected void validateBinaryOperatorTypes(final BinaryExpression binaryExpression) throws ExpressionParserException, ExpressionParserInternalError { InfoBinaryOperator binOpt = availableBinaryOperators.get(binaryExpression.getOperator().toUriLiteral()); List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); EdmType operand = binaryExpression.getLeftOperand().getEdmType(); if ((operand == null) && (resourceEntityType == null)) { return; } actualParameterTypes.add(operand); operand = binaryExpression.getRightOperand().getEdmType(); if ((operand == null) && (resourceEntityType == null)) { return; } actualParameterTypes.add(operand); ParameterSet parameterSet = binOpt.validateParameterSet(actualParameterTypes); if (parameterSet == null) { BinaryExpressionImpl binaryExpressionImpl = (BinaryExpressionImpl) binaryExpression; // Tested with TestParserExceptions.TestPMvalidateBinaryOperator throw FilterParserExceptionImpl.createINVALID_TYPES_FOR_BINARY_OPERATOR(binaryExpression.getOperator(), binaryExpression.getLeftOperand().getEdmType(), binaryExpression.getRightOperand().getEdmType(), binaryExpressionImpl.getToken(), curExpression); } binaryExpression.setEdmType(parameterSet.getReturnType()); }
expression.getUriLiteral()) .append("</span>, type <span class=\"type\">") .append(expression.getEdmType().toString()) .append("</span>"); if (kind == ExpressionKind.UNARY) {
expression.getUriLiteral()) .append("</span>, type <span class=\"type\">") .append(expression.getEdmType().toString()) .append("</span>"); if (kind == ExpressionKind.UNARY) {
final EdmType leftType = binaryExpression.getLeftOperand().getEdmType(); if (leftType == null && resourceEntityType == null) { return; final EdmType rightType = binaryExpression.getRightOperand().getEdmType(); if (rightType == null && resourceEntityType == null) { return; binaryExpression.getLeftOperand().getEdmType(), binaryExpression.getRightOperand().getEdmType(), binaryExpressionImpl.getToken(), curExpression);
final EdmType leftType = binaryExpression.getLeftOperand().getEdmType(); if (leftType == null && resourceEntityType == null) { return; final EdmType rightType = binaryExpression.getRightOperand().getEdmType(); if (rightType == null && resourceEntityType == null) { return; binaryExpression.getLeftOperand().getEdmType(), binaryExpression.getRightOperand().getEdmType(), binaryExpressionImpl.getToken(), curExpression);
if ((allowOnlyBinary == true) && (node.getEdmType() != null) && (node.getEdmType() != EdmSimpleTypeKind.Boolean.getEdmSimpleTypeInstance())) { throw FilterParserExceptionImpl.createTYPE_EXPECTED_AT(EdmBoolean.getInstance(), node.getEdmType(), 1, curExpression);
if ((allowOnlyBinary == true) && (node.getEdmType() != null) && (node.getEdmType() != EdmSimpleTypeKind.Boolean.getEdmSimpleTypeInstance())) { throw FilterParserExceptionImpl.createTYPE_EXPECTED_AT(EdmBoolean.getInstance(), node.getEdmType(), 1, curExpression);
if ((allowOnlyBinary == true) && (node.getEdmType() != null) && (node.getEdmType() != EdmSimpleTypeKind.Boolean.getEdmSimpleTypeInstance())) { throw FilterParserExceptionImpl.createTYPE_EXPECTED_AT(EdmBoolean.getInstance(), node.getEdmType(), 1, curExpression);