use of org.springframework.expression.spel.ast.TypeReference in project spring-framework by spring-projects.
the class InternalSpelExpressionParser method maybeEatTypeReference.
private boolean maybeEatTypeReference() {
if (peekToken(TokenKind.IDENTIFIER)) {
Token typeName = peekToken();
if (!"T".equals(typeName.stringValue())) {
return false;
}
// It looks like a type reference but is T being used as a map key?
Token t = nextToken();
if (peekToken(TokenKind.RSQUARE)) {
// looks like 'T]' (T is map key)
push(new PropertyOrFieldReference(false, t.data, toPos(t)));
return true;
}
eatToken(TokenKind.LPAREN);
SpelNodeImpl node = eatPossiblyQualifiedId();
// dotted qualified id
// Are there array dimensions?
int dims = 0;
while (peekToken(TokenKind.LSQUARE, true)) {
eatToken(TokenKind.RSQUARE);
dims++;
}
eatToken(TokenKind.RPAREN);
this.constructedNodes.push(new TypeReference(toPos(typeName), node, dims));
return true;
}
return false;
}
Aggregations