@Override public boolean matches(final INode other, final Match match) { if (other instanceof InstanceOfExpression) { final InstanceOfExpression otherExpression = (InstanceOfExpression) other; return !otherExpression.isNull() && getExpression().matches(otherExpression.getExpression(), match) && getType().matches(otherExpression.getType(), match); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof InstanceOfExpression) { final InstanceOfExpression otherExpression = (InstanceOfExpression) other; return !otherExpression.isNull() && getExpression().matches(otherExpression.getExpression(), match) && getType().matches(otherExpression.getType(), match); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof InstanceOfExpression) { final InstanceOfExpression otherExpression = (InstanceOfExpression) other; return !otherExpression.isNull() && getExpression().matches(otherExpression.getExpression(), match) && getType().matches(otherExpression.getType(), match); } return false; } }
@Override public Void visitInstanceOfExpression(final InstanceOfExpression node, final Void ignored) { startNode(node); node.getExpression().acceptVisitor(this, ignored); space(); writeKeyword(InstanceOfExpression.INSTANCE_OF_KEYWORD_ROLE); node.getType().acceptVisitor(this, ignored); endNode(node); return null; }
@Override public Void visitInstanceOfExpression(final InstanceOfExpression node, final Void ignored) { startNode(node); node.getExpression().acceptVisitor(this, ignored); space(); writeKeyword(InstanceOfExpression.INSTANCE_OF_KEYWORD_ROLE); node.getType().acceptVisitor(this, ignored); endNode(node); return null; }
@Override public Void visitInstanceOfExpression(final InstanceOfExpression node, final Void ignored) { startNode(node); node.getExpression().acceptVisitor(this, ignored); space(); writeKeyword(InstanceOfExpression.INSTANCE_OF_KEYWORD_ROLE); node.getType().acceptVisitor(this, ignored); endNode(node); return null; }
@Override public ResolveResult visitInstanceOfExpression(final InstanceOfExpression node, final Void data) { final ResolveResult childResult = node.getExpression().acceptVisitor(this, data); if (childResult == null) { return new ResolveResult(BuiltinTypes.Boolean); } final TypeReference childType = childResult.getType(); final ResolveResult typeResult = resolveType(node.getType()); if (childType == null || typeResult == null || typeResult.getType() == null) { return new ResolveResult(BuiltinTypes.Boolean); } return new PrimitiveResolveResult( BuiltinTypes.Boolean, MetadataHelper.isSubType(typeResult.getType(), childType) ); }
@Override public ResolveResult visitInstanceOfExpression(final InstanceOfExpression node, final Void data) { final ResolveResult childResult = node.getExpression().acceptVisitor(this, data); if (childResult == null) { return new ResolveResult(BuiltinTypes.Boolean); } final TypeReference childType = childResult.getType(); final ResolveResult typeResult = resolveType(node.getType()); if (childType == null || typeResult == null || typeResult.getType() == null) { return new ResolveResult(BuiltinTypes.Boolean); } return new PrimitiveResolveResult( BuiltinTypes.Boolean, MetadataHelper.isSubType(typeResult.getType(), childType) ); }
@Override public ResolveResult visitInstanceOfExpression(final InstanceOfExpression node, final Void data) { final ResolveResult childResult = node.getExpression().acceptVisitor(this, data); if (childResult == null) { return new ResolveResult(BuiltinTypes.Boolean); } final TypeReference childType = childResult.getType(); final ResolveResult typeResult = resolveType(node.getType()); if (childType == null || typeResult == null || typeResult.getType() == null) { return new ResolveResult(BuiltinTypes.Boolean); } return new PrimitiveResolveResult( BuiltinTypes.Boolean, MetadataHelper.isSubType(typeResult.getType(), childType) ); }