Beispiel #1
0
 /** Rewrite left and right */
 @Override
 public void visit(final OpUnion opUnion) {
   if (LOG.isDebugEnabled()) {
     LOG.debug("Starting visiting OpUnion");
   }
   final OpRewriter rewriter = new OpRewriter(securityEvaluator, graphIRI);
   addOp(OpUnion.create(rewriteOp2(opUnion, rewriter), rewriter.getResult()));
 }
Beispiel #2
0
 /**
  * rewrite source to dest and returns dest
  *
  * @param source
  * @param dest
  * @return the rewritten op.
  */
 private OpN rewriteOpN(final OpN source, final OpN dest) {
   final OpRewriter rewriter = new OpRewriter(securityEvaluator, graphIRI);
   for (final Op o : source.getElements()) {
     o.visit(rewriter.reset());
     dest.add(rewriter.getResult());
   }
   return dest;
 }
Beispiel #3
0
 /** rewrites the subop of graph. */
 @Override
 public void visit(final OpGraph opGraph) {
   if (LOG.isDebugEnabled()) {
     LOG.debug("Starting visiting OpGraph");
   }
   final OpRewriter rewriter = new OpRewriter(securityEvaluator, opGraph.getNode());
   opGraph.getSubOp().visit(rewriter);
   addOp(new OpGraph(opGraph.getNode(), rewriter.getResult()));
 }
Beispiel #4
0
 /**
  * rewrites the left and right parts of the op2 the left part is returned the right part is placed
  * in the rewriter
  *
  * @param op2
  * @param rewriter
  * @return the rewritten op.
  */
 private Op rewriteOp2(final Op2 op2, final OpRewriter rewriter) {
   op2.getLeft().visit(rewriter.reset());
   final Op left = rewriter.getResult();
   op2.getRight().visit(rewriter.reset());
   return left;
 }
Beispiel #5
0
 /**
  * Rewrites the subop of op1 and returns the result.
  *
  * @param op1
  * @return the rewritten op.
  */
 private Op rewriteOp1(final Op1 op1) {
   final OpRewriter rewriter = new OpRewriter(securityEvaluator, graphIRI);
   op1.getSubOp().visit(rewriter);
   return rewriter.getResult();
 }