コード例 #1
0
  public FilterValidator isMemberStartType(final FullQualifiedName fullName) {
    if (!(curExpression instanceof MemberImpl)) {
      fail("Current expression not a member");
    }

    MemberImpl member = (MemberImpl) curExpression;
    EdmType actualType = member.getStartTypeFilter();

    FullQualifiedName actualName =
        new FullQualifiedName(actualType.getNamespace(), actualType.getName());
    assertEquals(fullName, actualName);
    return this;
  }
コード例 #2
0
  public FilterValidator isType(final FullQualifiedName fullName) {
    EdmType actualType = null;

    if (curExpression instanceof MemberImpl) {
      Member member = (Member) curExpression;
      actualType = member.getType();
    } else if (curExpression instanceof TypeLiteralImpl) {
      TypeLiteralImpl typeLiteral = (TypeLiteralImpl) curExpression;
      actualType = typeLiteral.getType();
    } else if (curExpression instanceof LiteralImpl) {
      LiteralImpl typeLiteral = (LiteralImpl) curExpression;
      actualType = typeLiteral.getType();
    }

    if (actualType == null) {
      fail("Current expression not typed");
    }

    FullQualifiedName actualName =
        new FullQualifiedName(actualType.getNamespace(), actualType.getName());
    assertEquals(fullName, actualName);
    return this;
  }