com.github.simy4.xpath.expr.AbstractOperationExpr Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xpath-to-xml-core Show documentation
Show all versions of xpath-to-xml-core Show documentation
Convenient utility to build XML models by evaluating XPath expressions
package com.github.simy4.xpath.expr;
import com.github.simy4.xpath.XmlBuilderException;
import com.github.simy4.xpath.navigator.Node;
import com.github.simy4.xpath.view.View;
import com.github.simy4.xpath.view.ViewContext;
abstract class AbstractOperationExpr implements Expr {
private final Expr leftExpr;
private final Expr rightExpr;
AbstractOperationExpr(Expr leftExpr, Expr rightExpr) {
this.leftExpr = leftExpr;
this.rightExpr = rightExpr;
}
@Override
public final View resolve(ViewContext context) throws XmlBuilderException {
final View leftView = leftExpr.resolve(context);
final View rightView = rightExpr.resolve(context);
return resolve(context, leftView, rightView);
}
abstract View resolve(ViewContext context, View left, View right)
throws XmlBuilderException;
abstract String operator();
@Override
public final String toString() {
return leftExpr.toString() + operator() + rightExpr.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy