- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.pervasive.datarush.exceptions.DRException
-
- com.pervasive.datarush.functions.InvalidOperandTypeException
-
- All Implemented Interfaces:
Serializable
public class InvalidOperandTypeException extends DRException
An exception indicating the data type of a subexpression is not valid for use in the containing expression.These errors are typically raised at one of two times:
- During definition of a function instance, when it is determined that upper bounds on the expression cannot satisfy requirements.
- When constructing an evaluator in the context of a record schema and the subexpression fails to satisfy requirements.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InvalidOperandTypeException(String reason)
Declares an exception occurred for the specified reason.InvalidOperandTypeException(String reason, ScalarValuedFunction operand, ScalarTokenType operandType)
Declares an exception occurred for the specified reason, caused by the given subexpression yielding a result of the given type.InvalidOperandTypeException(String reason, ScalarTokenType required)
Declares an exception occurred for the specified reason.InvalidOperandTypeException(String reason, ScalarTokenType required, ScalarValuedFunction operand, ScalarTokenType operandType)
Declares an exception occurred for the specified reason, caused by the given subexpression yielding a result of the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOperand(ScalarValuedFunction operand, ScalarTokenType operandType)
Adds an additional subexpression and its type to the error.String
getMessage()
ScalarTokenType
getRequiredType()
Gets the type requirement which failed to be satisfied.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
InvalidOperandTypeException
public InvalidOperandTypeException(String reason)
Declares an exception occurred for the specified reason. No type requirement is provided with the error.- Parameters:
reason
- an explanation of the cause of the error
-
InvalidOperandTypeException
public InvalidOperandTypeException(String reason, ScalarTokenType required)
Declares an exception occurred for the specified reason.- Parameters:
reason
- an explanation of the cause of the errorrequired
- the type requirement which could not be met
-
InvalidOperandTypeException
public InvalidOperandTypeException(String reason, ScalarValuedFunction operand, ScalarTokenType operandType)
Declares an exception occurred for the specified reason, caused by the given subexpression yielding a result of the given type.- Parameters:
reason
- an explanation of the cause of the erroroperand
- the offending subexpressionoperandType
- the result type of the offending subexpression
-
InvalidOperandTypeException
public InvalidOperandTypeException(String reason, ScalarTokenType required, ScalarValuedFunction operand, ScalarTokenType operandType)
Declares an exception occurred for the specified reason, caused by the given subexpression yielding a result of the given type.- Parameters:
reason
- an explanation of the cause of the errorrequired
- the type requirement which could not be metoperand
- the offending subexpressionoperandType
- the result type of the offending subexpression
-
-
Method Detail
-
addOperand
public void addOperand(ScalarValuedFunction operand, ScalarTokenType operandType)
Adds an additional subexpression and its type to the error.In some cases, the type requirement may involve multiple subexpressions; for instance, if all arguments must be comparable. Use this method to this additional information to the exception.
- Parameters:
operand
- the offending subexpressionoperandType
- the result type of the offending subexpression
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
getRequiredType
public ScalarTokenType getRequiredType()
Gets the type requirement which failed to be satisfied.In some cases, this may return
TokenTypeConstant.SCALAR
, indicating the requirement is more complex than can be expressed by a single type value.- Returns:
- the type which was required
-
-