public static ExpressionParserInternalError createCOMMON(final Throwable e) { return new ExpressionParserInternalError(COMMON, e); }
public static ExpressionParserInternalError createERROR_PARSING_PARENTHESIS( final CommonExpression parenthesisExpression, final TokenizerExpectError cause) { return new ExpressionParserInternalError(ERROR_PARSING_PARENTHESIS, cause).setExpression(parenthesisExpression); }
public Token expectToken(final String literal, final boolean throwInternal) throws ExpressionParserInternalError { Token actual = next(); if (actual == null) { throw ExpressionParserInternalError.createNO_TOKEN_AVAILABLE(literal); } if (!literal.equals(actual.getUriLiteral())) { if (throwInternal) { throw ExpressionParserInternalError.createINVALID_TOKEN_AT(literal, actual); } } return actual; }
public Token expectToken(final TokenKind comma, final boolean throwFilterExpression) throws ExpressionParserInternalError { Token actual = next(); if (actual == null) { throw ExpressionParserInternalError.createNO_TOKEN_AVAILABLE(comma.toString()); } if (comma != actual.getKind()) { if (throwFilterExpression) { throw ExpressionParserInternalError.createINVALID_TOKENKIND_AT(comma, actual); } } return actual; }
protected void validateEdmPropertyOfStructuredType(final EdmStructuralType parentType, final PropertyExpressionImpl property, final Token propertyToken) throws ExpressionParserException, ExpressionParserInternalError { try { String propertyName = property.getUriLiteral(); EdmTyped edmProperty = parentType.getProperty(propertyName); if (edmProperty != null) { property.setEdmProperty(edmProperty); property.setEdmType(edmProperty.getType()); } else { // Tested with TestParserExceptions.TestPMvalidateEdmProperty CASE 3 throw FilterParserExceptionImpl.createPROPERTY_NAME_NOT_FOUND_IN_TYPE(parentType, property, propertyToken, curExpression); } } catch (EdmException e) { // not Tested, should not occur throw ExpressionParserInternalError.createERROR_ACCESSING_EDM(e); } }
} else { throw ExpressionParserInternalError.createCOMMON();
public Token expectToken(final String literal, final boolean throwInternal) throws ExpressionParserInternalError { Token actual = next(); if (actual == null) { throw ExpressionParserInternalError.createNO_TOKEN_AVAILABLE(literal); } if (!literal.equals(actual.getUriLiteral())) { if (throwInternal) { throw ExpressionParserInternalError.createINVALID_TOKEN_AT(literal, actual); } } return actual; }
public Token expectToken(final TokenKind comma, final boolean throwFilterExpression) throws ExpressionParserInternalError { Token actual = next(); if (actual == null) { throw ExpressionParserInternalError.createNO_TOKEN_AVAILABLE(comma.toString()); } if (comma != actual.getKind()) { if (throwFilterExpression) { throw ExpressionParserInternalError.createINVALID_TOKENKIND_AT(comma, actual); } } return actual; }
public static ExpressionParserException createPROPERTY_NAME_NOT_FOUND_IN_TYPE(final EdmStructuralType parentType, final PropertyExpression property, final Token token, final String expression) throws ExpressionParserInternalError { MessageReference msgRef = ExpressionParserException.PROPERTY_NAME_NOT_FOUND_IN_TYPE.create(); try { msgRef.addContent(property.getUriLiteral()); msgRef.addContent(parentType.getNamespace() + "." + parentType.getName()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); } catch (EdmException e) { throw ExpressionParserInternalError.createERROR_ACCESSING_EDM(e); } return new ExpressionParserException(msgRef); }
} else { throw ExpressionParserInternalError.createCOMMON();
public static ExpressionParserInternalError createINVALID_TYPE_COUNT() { return new ExpressionParserInternalError(INVALID_TYPE_COUNT); }
public Token expectToken(final String literal, final boolean throwInternal) throws ExpressionParserInternalError { Token actual = next(); if (actual == null) { throw ExpressionParserInternalError.createNO_TOKEN_AVAILABLE(literal); } if (!literal.equals(actual.getUriLiteral())) { if (throwInternal) { throw ExpressionParserInternalError.createINVALID_TOKEN_AT(literal, actual); } } return actual; }
public Token expectToken(final TokenKind comma, final boolean throwFilterExpression) throws ExpressionParserInternalError { Token actual = next(); if (actual == null) { throw ExpressionParserInternalError.createNO_TOKEN_AVAILABLE(comma.toString()); } if (comma != actual.getKind()) { if (throwFilterExpression) { throw ExpressionParserInternalError.createINVALID_TOKENKIND_AT(comma, actual); } } return actual; }
public static ExpressionParserInternalError createERROR_PARSING_PARENTHESIS( final CommonExpression parenthesisExpression, final TokenizerExpectError cause) { return new ExpressionParserInternalError(ERROR_PARSING_PARENTHESIS, cause).setExpression(parenthesisExpression); }
public static ExpressionParserException createLEFT_SIDE_NOT_STRUCTURAL_TYPE(final EdmType parentType, final PropertyExpressionImpl property, final Token token, final String expression) throws ExpressionParserInternalError { MessageReference msgRef = ExpressionParserException.LEFT_SIDE_NOT_STRUCTURAL_TYPE.create(); try { msgRef.addContent(property.getUriLiteral()); msgRef.addContent(parentType.getNamespace() + "." + parentType.getName()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); } catch (EdmException e) { throw ExpressionParserInternalError.createERROR_ACCESSING_EDM(e); } return new ExpressionParserException(msgRef); }
} else { throw ExpressionParserInternalError.createCOMMON();
public static ExpressionParserInternalError createERROR_ACCESSING_EDM(final EdmException cause) { return new ExpressionParserInternalError(ERROR_ACCESSING_EDM, cause); }
public static ExpressionParserInternalError createERROR_PARSING_PARENTHESIS( final CommonExpression parenthesisExpression, final TokenizerExpectError cause) { return new ExpressionParserInternalError(ERROR_PARSING_PARENTHESIS, cause).setExpression(parenthesisExpression); }
public static ExpressionParserException createPROPERTY_NAME_NOT_FOUND_IN_TYPE(final EdmStructuralType parentType, final PropertyExpression property, final Token token, final String expression) throws ExpressionParserInternalError { MessageReference msgRef = ExpressionParserException.PROPERTY_NAME_NOT_FOUND_IN_TYPE.create(); try { msgRef.addContent(property.getUriLiteral()); msgRef.addContent(parentType.getNamespace() + "." + parentType.getName()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); } catch (EdmException e) { throw ExpressionParserInternalError.createERROR_ACCESSING_EDM(e); } return new ExpressionParserException(msgRef); }
throw ExpressionParserInternalError.createCOMMON();