Search in sources :

Example 1 with ApplyTransformVisitor

use of org.apache.jena.sparql.algebra.walker.ApplyTransformVisitor in project jena by apache.

the class Transformer method transformSkipService.

/** Transform an algebra expression except skip (leave alone) any OpService nodes */
public static Op transformSkipService(Transform opTransform, ExprTransform exprTransform, Op op, OpVisitor beforeVisitor, OpVisitor afterVisitor) {
    if (true) {
        // XXX XXX Better work with Walker.
        if (opTransform == null)
            opTransform = new TransformCopy();
        if (exprTransform == null)
            exprTransform = new ExprTransformCopy();
        Transform transform2 = new TransformSkipService(opTransform);
        transform2 = opTransform;
        ApplyTransformVisitor atv = new ApplyTransformVisitor(transform2, exprTransform, false, beforeVisitor, afterVisitor);
        return Walker.transformSkipService(op, atv, beforeVisitor, afterVisitor);
    }
    Transform transform = new TransformSkipService(opTransform);
    return Transformer.transform(transform, exprTransform, op, beforeVisitor, afterVisitor);
//        // OLD
//        // Simplest way but still walks the OpService subtree (and throws away the
//        // transformation).
//        Transform transform = new TransformSkipService(opTransform) ;
//        return Transformer.transform(transform, exprTransform, op, beforeVisitor, afterVisitor) ;
}
Also used : ExprTransformCopy(org.apache.jena.sparql.expr.ExprTransformCopy) ExprTransformCopy(org.apache.jena.sparql.expr.ExprTransformCopy) ApplyTransformVisitor(org.apache.jena.sparql.algebra.walker.ApplyTransformVisitor) ExprTransform(org.apache.jena.sparql.expr.ExprTransform)

Aggregations

ApplyTransformVisitor (org.apache.jena.sparql.algebra.walker.ApplyTransformVisitor)1 ExprTransform (org.apache.jena.sparql.expr.ExprTransform)1 ExprTransformCopy (org.apache.jena.sparql.expr.ExprTransformCopy)1