public FilterValidator isMemberStartType(final FullQualifiedName fullName) { isMember(); Member member = (Member) curExpression; EdmType actualType = member.getStartTypeFilter(); assertEquals(fullName, actualType.getFullQualifiedName()); return this; }
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; }
private String getAliasedFullQualifiedName(final EdmType type, final boolean isCollection) { FullQualifiedName fqn = type.getFullQualifiedName(); final String name; if (namespaceToAlias.get(fqn.getNamespace()) != null) { name = namespaceToAlias.get(fqn.getNamespace()) + "." + fqn.getName(); } else { name = fqn.getFullQualifiedNameAsString(); } return isCollection ? "Collection(" + name + ")" : name; }
public FilterValidator isType(final FullQualifiedName fullName) { EdmType actualType = null; if (curExpression instanceof Member) { Member member = (Member) curExpression; actualType = member.getType(); } else if (curExpression instanceof TypeLiteral) { TypeLiteral typeLiteral = (TypeLiteral) curExpression; actualType = typeLiteral.getType(); } else if (curExpression instanceof Literal) { Literal typeLiteral = (Literal) curExpression; actualType = typeLiteral.getType(); } if (actualType == null) { fail("Current expression not typed"); } assertEquals(fullName, actualType.getFullQualifiedName()); return this; }
public FilterValidator isType(final FullQualifiedName fullName) { EdmType actualType = null; if (curExpression instanceof Member) { actualType = ((Member) curExpression).getType(); } else if (curExpression instanceof TypeLiteral) { actualType = ((TypeLiteral) curExpression).getType(); } else if (curExpression instanceof Literal) { actualType = ((Literal) curExpression).getType(); } else if (curExpression instanceof Enumeration) { actualType = ((Enumeration) curExpression).getType(); } else if (curExpression instanceof Unary) { actualType = ((UnaryImpl) curExpression).getType(); } else if (curExpression instanceof Binary) { actualType = ((BinaryImpl) curExpression).getType(); } else if (curExpression instanceof Method) { actualType = ((MethodImpl) curExpression).getType(); } assertNotNull("Current expression not typed", actualType); assertEquals(fullName, actualType.getFullQualifiedName()); return this; }
private String getFullQualifiedName(final EdmType type, final boolean isCollection) { final String name = type.getFullQualifiedName().getFullQualifiedNameAsString(); return isCollection ? "Collection(" + name + ")" : name; }