Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) 2009 Mysema Ltd.
  * All rights reserved.
  * 
  */
 package com.mysema.rdfbean.sesame.query;
 
import  org.openrdf.query.algebra.Exists;
import  org.openrdf.query.algebra.TupleExpr;
import  org.openrdf.query.algebra.ValueExpr;
ExistsTransformer provides

Author(s):
tiwe
Version:
$Id$
public class ExistsTransformer implements OperationTransformer{
    @Override
    public ValueExpr transform(Operation<?,?> operationTransformerContext context) {
        if (operation.getArg(0) instanceof SubQuery){
            SubQuery subQuery = (SubQueryoperation.getArg(0);
            TupleExpr tupleExpr = context.toTuples(subQuery);
            return new Exists(tupleExpr);    
        }else{
            throw new IllegalArgumentException("Illegal expression " + operation);
        }        
    }
    @Override
    public Collection<? extends Operator<?>> getSupportedOperations() {
        return Collections.singleton(.);
    }
New to GrepCode? Check out our FAQ X