SpelParseException class

The text of a SpEL expression is not valid; messageCode says what is wrong.

Thrown by SpelExpressionParser.parseExpression before any evaluation: a syntax error, a character SpEL does not know, a text longer than maximumExpressionLength or nested deeper than maximumNestingDepth.

// An operator without its right operand.
try {
  SpelExpressionParser().parseExpression('1 +');
} on SpelParseException catch (e) {
  e.messageCode; // SpelMessage.ood
}

Spring (Java):

try {
  new SpelExpressionParser().parseExpression("1 +");
} catch (SpelParseException ex) {
  SpelMessage code = ex.getMessageCode(); // OOD
}
Inheritance

Constructors

SpelParseException(SpelMessage messageCode, {List<Object?> inserts = const [], String? expressionString, int position = -1})
Creates a parse error of messageCode formatted with inserts.

Properties

cause → Object?
The error that caused this one (a converter's or an accessor's), or null.
finalinherited
expressionString → String?
The text of the failed expression, or null when unknown.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
inserts → List<Object?>
The values put into the message, such as the unexpected token (Spring's getInserts()); unmodifiable.
final
message → String
The full message, with the expression and position; the same as toDetailedString (Spring's getMessage()).
no setterinherited
messageCode → SpelMessage
What is wrong, as a code to compare against (Spring's getMessageCode()).
final
position → int
The character offset in expressionString where the problem was found, or -1 when unknown.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
simpleMessage → String
The reason alone, without the expression and position (Spring's getSimpleMessage()), such as EL1044E: Unexpectedly ran out of input.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDetailedString() → String
Expression [text] @position: message, or only simpleMessage when the expression is unknown (Spring's toDetailedString()).
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited