|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.rex.RexVisitorImpl<Boolean> org.eigenbase.rex.RexChecker
public class RexChecker
Visitor which checks the validity of a RexNode
expression.
There are two modes of operation:
fail=true
to throw an AssertionError
as soon as
an invalid node is detected:
RexNode node;
RelDataType rowType;
assert new RexChecker(rowType, true).isValid(node);
This mode requires that assertions are enabled.fail=false
to test for validity without throwing an
error.
RexNode node;
RelDataType rowType;
RexChecker checker = new RexChecker(rowType, false);
node.accept(checker);
if (!checker.valid) {
...
}
RexNode
Field Summary | |
---|---|
protected boolean |
fail
|
protected int |
failCount
|
protected List<RelDataType> |
inputTypeList
|
Fields inherited from class org.eigenbase.rex.RexVisitorImpl |
---|
deep |
Constructor Summary | |
---|---|
RexChecker(List<RelDataType> inputTypeList,
boolean fail)
Creates a RexChecker with a given set of input fields. |
|
RexChecker(RelDataType inputRowType,
boolean fail)
Creates a RexChecker with a given input row type. |
Method Summary | |
---|---|
int |
getFailureCount()
Returns the number of failures encountered. |
boolean |
isValid(RexNode expr)
Returns whether an expression is valid. |
Boolean |
visitCall(RexCall call)
|
Boolean |
visitFieldAccess(RexFieldAccess fieldAccess)
|
Boolean |
visitInputRef(RexInputRef ref)
|
Boolean |
visitLocalRef(RexLocalRef ref)
|
Methods inherited from class org.eigenbase.rex.RexVisitorImpl |
---|
visitArrayAnd, visitArrayOr, visitCorrelVariable, visitDynamicParam, visitLiteral, visitOver, visitRangeRef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final boolean fail
protected final List<RelDataType> inputTypeList
protected int failCount
Constructor Detail |
---|
public RexChecker(RelDataType inputRowType, boolean fail)
If fail
is true, the checker will throw an AssertionError
if an invalid node is found and assertions are enabled.
Otherwise, each method returns whether its part of the tree is valid.
inputRowType
- Input row typefail
- Whether to throw an AssertionError
if an invalid node
is detectedpublic RexChecker(List<RelDataType> inputTypeList, boolean fail)
If fail
is true, the checker will throw an AssertionError
if an invalid node is found and assertions are enabled.
Otherwise, each method returns whether its part of the tree is valid.
inputTypeList
- Input row typefail
- Whether to throw an AssertionError
if an invalid node
is detectedMethod Detail |
---|
public int getFailureCount()
public Boolean visitInputRef(RexInputRef ref)
visitInputRef
in interface RexVisitor<Boolean>
visitInputRef
in class RexVisitorImpl<Boolean>
public Boolean visitLocalRef(RexLocalRef ref)
visitLocalRef
in interface RexVisitor<Boolean>
visitLocalRef
in class RexVisitorImpl<Boolean>
public Boolean visitCall(RexCall call)
visitCall
in interface RexVisitor<Boolean>
visitCall
in class RexVisitorImpl<Boolean>
public Boolean visitFieldAccess(RexFieldAccess fieldAccess)
visitFieldAccess
in interface RexVisitor<Boolean>
visitFieldAccess
in class RexVisitorImpl<Boolean>
public final boolean isValid(RexNode expr)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |