StandardOperatorOverloader class final
The default OperatorOverloader: it takes over no operator, so
arithmetic on operands without a built-in rule fails with
operatorNotSupportedBetweenTypes (EL1030E).
Every context starts with it; replace it on a
StandardEvaluationContext to give operators a meaning for your types.
// `{1} + {2}` is not supported by default.
const StandardOperatorOverloader()
.overridesOperation(Operation.add, [1], [2]); // false
Spring (Java):
OperatorOverloader overloader = new StandardOperatorOverloader();
- Implemented types
Constructors
- StandardOperatorOverloader()
-
Creates the overloader (stateless).
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
operate(
Operation operation, Object? left, Object? right) → Object? -
Performs
operation; only called after overridesOperation returnedtrue.override -
overridesOperation(
Operation operation, Object? left, Object? right) → bool -
Whether this overloader handles
operationforleftandright.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited