[core] Apply PR review suggestions, refs #2382

This commit is contained in:
Andreas Dangel
2020-03-27 17:46:07 +01:00
parent 8ffe160f12
commit 263c6e0d09
4 changed files with 6 additions and 5 deletions

View File

@ -20,7 +20,7 @@ import net.sf.saxon.om.Axis;
* printer.visit(query.xpathExpression.getInternalExpression());
* </pre>
*/
public class ExpressionPrinter extends Visitor {
public class ExpressionPrinter extends SaxonExprVisitor {
private int depth = 0;
private void print(String s) {

View File

@ -34,7 +34,7 @@ import net.sf.saxon.type.Type;
* <p>DocumentSorter expression is removed. The sorting of the resulting nodes needs to be done
* after all (sub)expressions have been executed.
*/
public class RuleChainAnalyzer extends Visitor {
public class RuleChainAnalyzer extends SaxonExprVisitor {
private final Configuration configuration;
private String rootElement;
private boolean rootElementReplaced;
@ -107,9 +107,10 @@ public class RuleChainAnalyzer extends Visitor {
@Override
public Expression visit(LazyExpression e) {
boolean prevCtx = insideLazyExpression;
insideLazyExpression = true;
Expression result = super.visit(e);
insideLazyExpression = false;
insideLazyExpression = prevCtx;
return result;
}

View File

@ -16,7 +16,7 @@ import net.sf.saxon.expr.RootExpression;
import net.sf.saxon.expr.VennExpression;
import net.sf.saxon.sort.DocumentSorter;
abstract class Visitor {
abstract class SaxonExprVisitor {
public Expression visit(DocumentSorter e) {
Expression base = visit(e.getBaseExpression());
return new DocumentSorter(base);

View File

@ -17,7 +17,7 @@ import net.sf.saxon.expr.VennExpression;
*
* <p>E.g. "//A | //B | //C" will result in 3 expressions "//A", "//B", and "//C".
*/
class SplitUnions extends Visitor {
class SplitUnions extends SaxonExprVisitor {
private List<Expression> expressions = new ArrayList<>();
@Override