Package org.apache.olingo.odata2.api.exception

Examples of org.apache.olingo.odata2.api.exception.MessageReference


    return new ExpressionParserException(msgRef);
  }

  public static ExpressionParserException createLEFT_SIDE_NOT_A_PROPERTY(final Token token, final String expression)
      throws ExpressionParserInternalError {
    MessageReference msgRef = ExpressionParserException.LEFT_SIDE_NOT_A_PROPERTY.create();

    msgRef.addContent(token.getPosition() + 1);
    msgRef.addContent(expression);

    return new ExpressionParserException(msgRef);
  }
View Full Code Here


  }

  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);
View Full Code Here

  }

  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);
View Full Code Here

    return new ExpressionParserException(msgRef);
  }

  public static ExpressionParserException
      createTOKEN_UNDETERMINATED_STRING(final int position, final String expression) {
    MessageReference msgRef = ExpressionParserException.TOKEN_UNDETERMINATED_STRING.create();

    msgRef.addContent(position + 1);
    msgRef.addContent(expression);

    return new ExpressionParserException(msgRef);
  }
View Full Code Here

    return new ExpressionParserException(msgRef);
  }

  public static ExpressionParserException createINVALID_TYPES_FOR_BINARY_OPERATOR(final BinaryOperator op,
      final EdmType left, final EdmType right, final Token token, final String expression) {
    MessageReference msgRef = ExpressionParserException.INVALID_TYPES_FOR_BINARY_OPERATOR.create();

    msgRef.addContent(op.toUriLiteral());

    try {
      msgRef.addContent(left.getNamespace() + "." + left.getName());
    } catch (EdmException e) {
      msgRef.addContent("");
    }
    try {
      msgRef.addContent(right.getNamespace() + "." + right.getName());
    } catch (EdmException e) {
      msgRef.addContent("");
    }
    msgRef.addContent(token.getPosition() + 1);
    msgRef.addContent(expression);

    return new ExpressionParserException(msgRef);
  }
View Full Code Here

    return new ExpressionParserException(msgRef);
  }

  public static ExpressionParserException createMISSING_CLOSING_PHARENTHESIS(final int position,
      final String expression, final TokenizerExpectError e) {
    MessageReference msgRef = ExpressionParserException.MISSING_CLOSING_PHARENTHESIS.create();

    msgRef.addContent(position + 1);
    msgRef.addContent(expression);

    return new ExpressionParserException(msgRef, e);
  }
View Full Code Here

    return new ExpressionParserException(msgRef, e);
  }

  public static ExpressionParserException createINVALID_SORT_ORDER(final Token token, final String expression) {
    MessageReference msgRef = ExpressionParserException.INVALID_SORT_ORDER.create();
    msgRef.addContent(token.getPosition() + 1);
    msgRef.addContent(expression);

    return new ExpressionParserException(msgRef);
  }
View Full Code Here

    return new ExpressionParserException(msgRef);
  }

  public static ExpressionParserException createINVALID_METHOD_CALL(final CommonExpression leftNode,
      final Token prevToken, final String expression) {
    final MessageReference msgRef = ExpressionParserException.INVALID_METHOD_CALL.create();

    msgRef.addContent(leftNode.getUriLiteral());
    msgRef.addContent(prevToken.getPosition() + 1);
    msgRef.addContent(expression);

    return new ExpressionParserException(msgRef);

  }
View Full Code Here

  }

  public static ExpressionParserException createTYPE_EXPECTED_AT(final EdmType expectedType, final EdmType actualType,
      final int position, final String expression) {
    final MessageReference msgRef = ExpressionParserException.TYPE_EXPECTED_AT.create();

    try {
      msgRef.addContent(expectedType.getNamespace() + '.' + expectedType.getName());
    } catch (EdmException e) {
      msgRef.addContent("");
    }

    msgRef.addContent(position);
    msgRef.addContent(expression);

    if (actualType != null) {
      try {
        msgRef.addContent(actualType.getNamespace() + '.' + actualType.getName());
      } catch (EdmException e) {
        msgRef.addContent("");
      }
    } else {
      msgRef.addContent("null");
    }

    return new ExpressionParserException(msgRef);

  }
View Full Code Here

  private static final Locale DEFAULT_LANGUAGE = new Locale("test", "foo");

  @Test
  public void testResourceBundleException() throws Exception {
    MessageReference context = MessageReference.create(ODataMessageException.class, "COMMON");
    Message ms = MessageService.getMessage(null, context);

    assertEquals(
        "MessageService could not be created because of exception 'IllegalArgumentException with message " +
            "'Parameter locale MUST NOT be NULL.'.",
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.exception.MessageReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.