SpelMessage enum

The catalogue of SpEL failures: each value is one kind of error with its code (EL1005E) and message text.

Every SpelParseException and SpelEvaluationException carries one of these as its messageCode, so code can react to a specific failure (an unknown type, a missing property) without parsing the message text. Names (in lowerCamelCase), numbers and texts are Spring's, so a code looked up in Spring's documentation means the same here.

// Tell an unknown type apart from other failures.
try {
  SpelExpressionParser().parseExpression('T(Missing)').getValue();
} on SpelEvaluationException catch (e) {
  e.messageCode; // SpelMessage.typeNotFound
  e.simpleMessage; // EL1005E: Type cannot be found 'Missing'
}

Spring (Java):

try {
  parser.parseExpression("T(com.example.Missing)").getValue();
} catch (SpelEvaluationException ex) {
  SpelMessage code = ex.getMessageCode(); // TYPE_NOT_FOUND
}

A few codes are never raised here (no compiler, no Java arrays or static-method checks, no overloads) and exist so the numbering matches Spring; their comments say "not raised".

Inheritance
Available extensions

Values

typeConversionError → const SpelMessage

EL1001E: a value cannot be converted (also a condition that is not a boolean).

const SpelMessage(SpelMessageKind.error, 1001, 'Type conversion problem, cannot convert from {0} to {1}')
constructorNotFound → const SpelMessage

EL1002E: new Name(...) has no matching constructor.

const SpelMessage(SpelMessageKind.error, 1002, 'Constructor call: No suitable constructor found on type {0} for ' 'arguments {1}')
constructorInvocationProblem → const SpelMessage

EL1003E: a constructor resolver failed.

const SpelMessage(SpelMessageKind.error, 1003, 'A problem occurred whilst attempting to construct an object of type ' "''{0}'' using arguments ''{1}''"…
methodNotFound → const SpelMessage

EL1004E: no method resolver handles the call.

const SpelMessage(SpelMessageKind.error, 1004, 'Method call: Method {0} cannot be found on type {1}')
typeNotFound → const SpelMessage

EL1005E: T(Name) names an unknown type.

const SpelMessage(SpelMessageKind.error, 1005, "Type cannot be found ''{0}''")
functionNotDefined → const SpelMessage

EL1006E: #name(...) is not registered.

const SpelMessage(SpelMessageKind.error, 1006, "Function ''{0}'' could not be found")
propertyOrFieldNotReadableOnNull → const SpelMessage

EL1007E: a property was read on null without ?..

const SpelMessage(SpelMessageKind.error, 1007, "Property or field ''{0}'' cannot be found on null")
propertyOrFieldNotReadable → const SpelMessage

EL1008E: no property accessor can read the property.

const SpelMessage(SpelMessageKind.error, 1008, "Property or field ''{0}'' cannot be found on object of type ''{1}'' - " 'maybe not public or not valid?…
propertyOrFieldNotWritableOnNull → const SpelMessage

EL1009E: a property was written on null.

const SpelMessage(SpelMessageKind.error, 1009, "Property or field ''{0}'' cannot be set on null")
propertyOrFieldNotWritable → const SpelMessage

EL1010E: no property accessor can write the property.

const SpelMessage(SpelMessageKind.error, 1010, "Property or field ''{0}'' cannot be set on object of type ''{1}'' - " 'maybe not public or not writable?&#…
methodCallOnNullObjectNotAllowed → const SpelMessage

EL1011E: a method was called on null without ?..

const SpelMessage(SpelMessageKind.error, 1011, 'Method call: Attempted to call method {0} on null context object')
cannotIndexIntoNullValue → const SpelMessage

EL1012E: [...] was applied to null without ?..

const SpelMessage(SpelMessageKind.error, 1012, 'Cannot index into a null value')
notComparable → const SpelMessage

EL1013E: two values cannot be ordered.

const SpelMessage(SpelMessageKind.error, 1013, 'Cannot compare instances of {0} and {1}')
incorrectNumberOfArgumentsToFunction → const SpelMessage

EL1014E: a function got too few or too many arguments.

const SpelMessage(SpelMessageKind.error, 1014, "Incorrect number of arguments for function ''{0}'': {1} supplied but " 'function takes {2}')
invalidTypeForSelection → const SpelMessage

EL1015E: .?[...] on something that is not a collection or map.

const SpelMessage(SpelMessageKind.error, 1015, "Cannot perform selection on input data of type ''{0}''")
resultOfSelectionCriteriaIsNotBoolean → const SpelMessage

EL1016E: a selection criterion did not yield a boolean.

const SpelMessage(SpelMessageKind.error, 1016, 'Result of selection criteria is not boolean')
betweenRightOperandMustBeTwoElementList → const SpelMessage

EL1017E: the right side of between is not a two-element list.

const SpelMessage(SpelMessageKind.error, 1017, "Right operand for the 'between' operator has to be a two-element list")
invalidPattern → const SpelMessage

EL1018E: a matches pattern is not a valid regular expression.

const SpelMessage(SpelMessageKind.error, 1018, "Pattern is not valid ''{0}''")
projectionNotSupportedOnType → const SpelMessage

EL1019E: .![...] on something that is not a collection or map.

const SpelMessage(SpelMessageKind.error, 1019, "Projection is not supported on the type ''{0}''")
arglistShouldNotBeEvaluated → const SpelMessage

EL1020E: not raised (lambda argument lists).

const SpelMessage(SpelMessageKind.error, 1020, 'The argument list of a lambda expression should never have getValue() ' 'called upon it')
exceptionDuringPropertyRead → const SpelMessage

EL1021E: a property accessor threw while reading.

const SpelMessage(SpelMessageKind.error, 1021, "A problem occurred whilst attempting to access the property ''{0}'': " "''{1}''")
functionReferenceCannotBeInvoked → const SpelMessage

EL1022E: #name(...) refers to a variable that is not a function.

const SpelMessage(SpelMessageKind.error, 1022, "The function ''{0}'' mapped to an object of type ''{1}'' cannot be " 'invoked')
exceptionDuringFunctionCall → const SpelMessage

EL1023E: a registered function threw.

const SpelMessage(SpelMessageKind.error, 1023, "A problem occurred whilst attempting to invoke the function ''{0}'': " "''{1}''")
arrayIndexOutOfBounds → const SpelMessage

EL1024E: not raised (Java arrays are lists here, see collectionIndexOutOfBounds).

const SpelMessage(SpelMessageKind.error, 1024, "The array has ''{0}'' elements, index ''{1}'' is invalid")
collectionIndexOutOfBounds → const SpelMessage

EL1025E: an index is outside a list or collection.

const SpelMessage(SpelMessageKind.error, 1025, "The collection has ''{0}'' elements, index ''{1}'' is invalid")
stringIndexOutOfBounds → const SpelMessage

EL1026E: an index is outside a string.

const SpelMessage(SpelMessageKind.error, 1026, "The string has ''{0}'' characters, index ''{1}'' is invalid")
indexingNotSupportedForType → const SpelMessage

EL1027E: the target cannot be indexed.

const SpelMessage(SpelMessageKind.error, 1027, "Indexing into type ''{0}'' is not supported")
instanceofOperatorNeedsClassOperand → const SpelMessage

EL1028E: the right side of instanceof is not a type.

const SpelMessage(SpelMessageKind.error, 1028, "The operator 'instanceof' needs the right operand to be a class, not a " "''{0}''")
exceptionDuringMethodInvocation → const SpelMessage

EL1029E: a method executor failed with an AccessException.

const SpelMessage(SpelMessageKind.error, 1029, "A problem occurred when trying to execute method ''{0}'' on object of " "type ''{1}'': ''{2}'…
operatorNotSupportedBetweenTypes → const SpelMessage

EL1030E: an operator does not support the operand types.

const SpelMessage(SpelMessageKind.error, 1030, "The operator ''{0}'' is not supported between objects of type ''{1}'' " "and ''{2}''"…
problemLocatingMethod → const SpelMessage

EL1031E: a method resolver failed with an AccessException.

const SpelMessage(SpelMessageKind.error, 1031, 'Problem locating method {0} on type {1}')
setvalueNotSupported → const SpelMessage

EL1032E: the node cannot be assigned (1 = 2).

const SpelMessage(SpelMessageKind.error, 1032, "setValue(ExpressionState, Object) not supported for ''{0}''")
multiplePossibleMethods → const SpelMessage

EL1033E: not raised (no overload resolution).

const SpelMessage(SpelMessageKind.error, 1033, "Method call of ''{0}'' is ambiguous, supported type conversions allow " 'multiple variants to match')
exceptionDuringPropertyWrite → const SpelMessage

EL1034E: a property accessor threw while writing.

const SpelMessage(SpelMessageKind.error, 1034, "A problem occurred whilst attempting to set the property ''{0}'': {1}")
notAnInteger → const SpelMessage

EL1035E: an integer literal is malformed.

const SpelMessage(SpelMessageKind.error, 1035, "The value ''{0}'' cannot be parsed as an int")
notALong → const SpelMessage

EL1036E: a long literal (...L) is malformed or too large.

const SpelMessage(SpelMessageKind.error, 1036, "The value ''{0}'' cannot be parsed as a long")
invalidFirstOperandForMatchesOperator → const SpelMessage

EL1037E: the left side of matches is not a string.

const SpelMessage(SpelMessageKind.error, 1037, "First operand to matches operator must be a string. ''{0}'' is not")
invalidSecondOperandForMatchesOperator → const SpelMessage

EL1038E: the right side of matches is not a string.

const SpelMessage(SpelMessageKind.error, 1038, "Second operand to matches operator must be a string. ''{0}'' is not")
functionMustBeStatic → const SpelMessage

EL1039E: not raised (functions are plain Dart functions).

const SpelMessage(SpelMessageKind.error, 1039, 'Only static methods can be called via function references. ' "The method ''{0}'' referred to by name ''{1}''…
notAReal → const SpelMessage

EL1040E: a real literal is malformed.

const SpelMessage(SpelMessageKind.error, 1040, "The value ''{0}'' cannot be parsed as a double")
moreInput → const SpelMessage

EL1041E: text follows a complete expression (1 2).

const SpelMessage(SpelMessageKind.error, 1041, 'After parsing a valid expression, there is still more data in the ' "expression: ''{0}''")
rightOperandProblem → const SpelMessage

EL1042E: the right operand of an operator is missing.

const SpelMessage(SpelMessageKind.error, 1042, 'Problem parsing right operand')
notExpectedToken → const SpelMessage

EL1043E: the parser found a token it did not expect.

const SpelMessage(SpelMessageKind.error, 1043, "Unexpected token. Expected ''{0}'' but was ''{1}''")
ood → const SpelMessage

EL1044E: the expression ended too early (1 +, empty text).

const SpelMessage(SpelMessageKind.error, 1044, 'Unexpectedly ran out of input')
nonTerminatingDoubleQuotedString → const SpelMessage

EL1045E: a "..." string has no closing quote.

const SpelMessage(SpelMessageKind.error, 1045, 'Cannot find terminating " for string')
nonTerminatingQuotedString → const SpelMessage

EL1046E: a '...' string has no closing quote.

const SpelMessage(SpelMessageKind.error, 1046, "Cannot find terminating '' for string")
missingLeadingZeroForNumber → const SpelMessage

EL1047E: not raised (.5 fails with ood instead).

const SpelMessage(SpelMessageKind.error, 1047, "A real number must be prefixed by zero, it cannot start with just ''.''")
realCannotBeLong → const SpelMessage

EL1048E: a real literal has an L suffix (1.5L).

const SpelMessage(SpelMessageKind.error, 1048, 'Real number cannot be suffixed with a long (L or l) suffix')
unexpectedDataAfterDot → const SpelMessage

EL1049E: a dot is followed by something that is not a name.

const SpelMessage(SpelMessageKind.error, 1049, "Unexpected data after ''.'': ''{0}''")
missingConstructorArgs → const SpelMessage

EL1050E: new Name without (...) or [...].

const SpelMessage(SpelMessageKind.error, 1050, "The arguments '(...)' for the constructor call are missing")
runOutOfArguments → const SpelMessage

EL1051E: not raised.

const SpelMessage(SpelMessageKind.error, 1051, 'Unexpectedly ran out of arguments')
unableToGrowCollection → const SpelMessage

EL1052E: auto-growing a list beyond the configured maximum.

const SpelMessage(SpelMessageKind.error, 1052, 'Unable to grow collection')
unableToGrowCollectionUnknownElementType → const SpelMessage

EL1053E: auto-growing a list whose elements cannot be null.

const SpelMessage(SpelMessageKind.error, 1053, 'Unable to grow collection: unable to determine list element type')
unableToCreateListForIndexing → const SpelMessage

EL1054E: not raised (with auto-grow on, a null list property that cannot be created gives unableToDynamicallyCreateObject).

const SpelMessage(SpelMessageKind.error, 1054, 'Unable to dynamically create a List to replace a null value')
unableToCreateMapForIndexing → const SpelMessage

EL1055E: not raised (with auto-grow on, a null map property that cannot be created gives unableToDynamicallyCreateObject).

const SpelMessage(SpelMessageKind.error, 1055, 'Unable to dynamically create a Map to replace a null value')
unableToDynamicallyCreateObject → const SpelMessage

EL1056E: with auto-grow on, a null property could not be replaced by a new value (its type is unknown or cannot be created without arguments).

const SpelMessage(SpelMessageKind.error, 1056, "Unable to dynamically create instance of ''{0}'' to replace a null " 'value')
noBeanResolverRegistered → const SpelMessage

EL1057E: @bean was used but the context has no bean resolver.

const SpelMessage(SpelMessageKind.error, 1057, 'No bean resolver registered in the context to resolve access to bean ' "''{0}''")
exceptionDuringBeanResolution → const SpelMessage

EL1058E: the bean resolver failed with an AccessException.

const SpelMessage(SpelMessageKind.error, 1058, "A problem occurred when trying to resolve bean ''{0}'': ''{1}''")
invalidBeanReference → const SpelMessage

EL1059E: @ or & is not followed by a name.

const SpelMessage(SpelMessageKind.error, 1059, '@ or & can only be followed by an identifier or a quoted name')
typeNameExpectedForArrayConstruction → const SpelMessage

EL1060E: not raised (array type names are always identifiers).

const SpelMessage(SpelMessageKind.error, 1060, 'Expected the type of the new array to be specified as a String but ' "found ''{0}''")
incorrectElementTypeForArray → const SpelMessage

EL1061E: an array initializer element does not fit the element type.

const SpelMessage(SpelMessageKind.error, 1061, "The array of type ''{0}'' cannot have an element of type ''{1}'' " 'inserted')
multidimArrayInitializerNotSupported → const SpelMessage

EL1062E: new int[2][2]{...}.

const SpelMessage(SpelMessageKind.error, 1062, 'Using an initializer to build a multi-dimensional array is not ' 'currently supported')
missingArrayDimension → const SpelMessage

EL1063E: new int[] without a size or initializer.

const SpelMessage(SpelMessageKind.error, 1063, 'A required array dimension has not been specified')
initializerLengthIncorrect → const SpelMessage

EL1064E: new int[3]{1, 2}.

const SpelMessage(SpelMessageKind.error, 1064, 'Array initializer size does not match array dimensions')
unexpectedEscapeChar → const SpelMessage

EL1065E: a backslash outside a string (a \ b); strings have no backslash escapes.

const SpelMessage(SpelMessageKind.error, 1065, 'Unexpected escape character')
operandNotIncrementable → const SpelMessage

EL1066E: ++ on something that cannot be assigned.

const SpelMessage(SpelMessageKind.error, 1066, "The expression component ''{0}'' does not support increment")
operandNotDecrementable → const SpelMessage

EL1067E: -- on something that cannot be assigned.

const SpelMessage(SpelMessageKind.error, 1067, "The expression component ''{0}'' does not support decrement")
notAssignable → const SpelMessage

EL1068E: assignment is disabled in the context, or the target is read-only.

const SpelMessage(SpelMessageKind.error, 1068, "The expression component ''{0}'' is not assignable")
missingCharacter → const SpelMessage

EL1069E: an expected character is missing (a single |).

const SpelMessage(SpelMessageKind.error, 1069, "Missing expected character ''{0}''")
leftOperandProblem → const SpelMessage

EL1070E: the left operand of an operator is missing.

const SpelMessage(SpelMessageKind.error, 1070, 'Problem parsing left operand')
missingSelectionExpression → const SpelMessage

EL1071E: .?[] without a criterion.

const SpelMessage(SpelMessageKind.error, 1071, 'A required selection expression has not been specified')
exceptionRunningCompiledExpression → const SpelMessage

EL1072E: not raised (no compiler).

const SpelMessage(SpelMessageKind.error, 1072, 'An exception occurred whilst evaluating a compiled expression')
flawedPattern → const SpelMessage

EL1073E: a matches pattern has nested quantifiers (the shape of catastrophic backtracking).

const SpelMessage(SpelMessageKind.error, 1073, "Failed to efficiently evaluate pattern ''{0}'': consider redesigning it")
exceptionCompilingExpression → const SpelMessage

EL1074E: not raised (no compiler).

const SpelMessage(SpelMessageKind.error, 1074, 'An exception occurred while compiling an expression')
maxArrayElementsThresholdExceeded → const SpelMessage

EL1075E: new int[n] with more than 262 144 elements.

const SpelMessage(SpelMessageKind.error, 1075, "Array declares too many elements, exceeding the threshold of ''{0}''")
maxRepeatedTextSizeExceeded → const SpelMessage

EL1076E: 'text' * n longer than SpelLimits.maxRepeatedTextSize.

const SpelMessage(SpelMessageKind.error, 1076, "Repeated text is too long, exceeding the threshold of ''{0}'' " 'characters')
maxRegexLengthExceeded → const SpelMessage

EL1077E: a pattern longer than SpelLimits.maxRegexLength.

const SpelMessage(SpelMessageKind.error, 1077, "Regular expression is too long, exceeding the threshold of ''{0}'' " 'characters')
maxConcatenatedStringLengthExceeded → const SpelMessage

EL1078E: + would build a string longer than SpelLimits.maxConcatenatedStringLength.

const SpelMessage(SpelMessageKind.error, 1078, "Concatenated string is too long, exceeding the threshold of ''{0}'' " 'characters')
maxExpressionLengthExceeded → const SpelMessage

EL1079E: the expression is longer than SpelParserConfiguration.maximumExpressionLength.

const SpelMessage(SpelMessageKind.error, 1079, "SpEL expression is too long, exceeding the threshold of ''{0}'' " 'characters')
variableAssignmentNotSupported → const SpelMessage

EL1080E: the context forbids #name = ... (a SimpleEvaluationContext).

const SpelMessage(SpelMessageKind.error, 1080, "Assignment to variable ''{0}'' is not supported")
negativeRepeatedTextCount → const SpelMessage

EL1081E: 'text' * n with a negative n.

const SpelMessage(SpelMessageKind.error, 1081, "Repeat count ''{0}'' must not be negative")
unsupportedCharacter → const SpelMessage

EL1082E: a character that is not part of the SpEL syntax.

const SpelMessage(SpelMessageKind.error, 1082, "Unsupported character ''{0}'' ({1}) encountered in expression")
exceptionDuringIndexRead → const SpelMessage

EL1083E: an IndexAccessor threw while reading.

const SpelMessage(SpelMessageKind.error, 1083, "A problem occurred while attempting to read index ''{0}'' in ''{1}''")
exceptionDuringIndexWrite → const SpelMessage

EL1084E: an IndexAccessor threw while writing.

const SpelMessage(SpelMessageKind.error, 1084, "A problem occurred while attempting to write index ''{0}'' in ''{1}''")
maxOperationsExceeded → const SpelMessage

EL1085E: one evaluation used more than SpelParserConfiguration.maximumOperations operations.

const SpelMessage(SpelMessageKind.error, 1085, "SpEL expression evaluation exceeded the threshold of ''{0}'' operations")
maxBigPowerResultExceeded → const SpelMessage

EL1086E: not raised (no BigInt arithmetic).

const SpelMessage(SpelMessageKind.error, 1086, "BigDecimal/BigInteger power operation with base bit length ''{0}'' and " "exponent ''{1}''would produ…
maxExpressionNestingDepthExceeded → const SpelMessage

EL1087E: the expression nests deeper than SpelParserConfiguration.maximumNestingDepth.

const SpelMessage(SpelMessageKind.error, 1087, 'SpEL expression nesting depth exceeds the threshold of {0}')

Properties

code → int
The number, such as 1008 for EL1008E.
final
hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
kind → SpelMessageKind
The severity; SpelMessageKind.error for every message.
final
message → String
The message template in java.text.MessageFormat syntax ({0} placeholders, '' for a quote).
final
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

formatMessage([List<Object?> inserts = const []]) → String
The text of an exception: the code, then message with inserts in place of {0}, {1}, ... (integers with thousands separators, like Java's MessageFormat).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<SpelMessage>
A constant List of the values in this enum, in order of their declaration.