org.springframework.expression.spel.ast.MethodReference Java Examples

The following examples show how to use org.springframework.expression.spel.ast.MethodReference. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InternalSpelExpressionParser.java    From spring-analysis-note with MIT License 6 votes vote down vote up
private boolean maybeEatMethodOrProperty(boolean nullSafeNavigation) {
	if (peekToken(TokenKind.IDENTIFIER)) {
		Token methodOrPropertyName = takeToken();
		SpelNodeImpl[] args = maybeEatMethodArgs();
		if (args == null) {
			// property
			push(new PropertyOrFieldReference(nullSafeNavigation, methodOrPropertyName.stringValue(),
					methodOrPropertyName.startPos, methodOrPropertyName.endPos));
			return true;
		}
		// method reference
		push(new MethodReference(nullSafeNavigation, methodOrPropertyName.stringValue(),
				methodOrPropertyName.startPos, methodOrPropertyName.endPos, args));
		// TODO what is the end position for a method reference? the name or the last arg?
		return true;
	}
	return false;
}
 
Example #2
Source File: InternalSpelExpressionParser.java    From java-technology-stack with MIT License 6 votes vote down vote up
private boolean maybeEatMethodOrProperty(boolean nullSafeNavigation) {
	if (peekToken(TokenKind.IDENTIFIER)) {
		Token methodOrPropertyName = takeToken();
		SpelNodeImpl[] args = maybeEatMethodArgs();
		if (args == null) {
			// property
			push(new PropertyOrFieldReference(nullSafeNavigation, methodOrPropertyName.stringValue(),
					toPos(methodOrPropertyName)));
			return true;
		}
		// method reference
		push(new MethodReference(nullSafeNavigation, methodOrPropertyName.stringValue(),
				toPos(methodOrPropertyName), args));
		// TODO what is the end position for a method reference? the name or the last arg?
		return true;
	}
	return false;
}
 
Example #3
Source File: InternalSpelExpressionParser.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
private boolean maybeEatMethodOrProperty(boolean nullSafeNavigation) {
	if (peekToken(TokenKind.IDENTIFIER)) {
		Token methodOrPropertyName = nextToken();
		SpelNodeImpl[] args = maybeEatMethodArgs();
		if (args == null) {
			// property
			push(new PropertyOrFieldReference(nullSafeNavigation, methodOrPropertyName.data,
					toPos(methodOrPropertyName)));
			return true;
		}
		// method reference
		push(new MethodReference(nullSafeNavigation, methodOrPropertyName.data,
				toPos(methodOrPropertyName), args));
		// TODO what is the end position for a method reference? the name or the last arg?
		return true;
	}
	return false;
}
 
Example #4
Source File: InternalSpelExpressionParser.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
private boolean maybeEatMethodOrProperty(boolean nullSafeNavigation) {
	if (peekToken(TokenKind.IDENTIFIER)) {
		Token methodOrPropertyName = nextToken();
		SpelNodeImpl[] args = maybeEatMethodArgs();
		if (args==null) {
			// property
			push(new PropertyOrFieldReference(nullSafeNavigation, methodOrPropertyName.data,toPos(methodOrPropertyName)));
			return true;
		}
		// methodreference
		push(new MethodReference(nullSafeNavigation, methodOrPropertyName.data, toPos(methodOrPropertyName), args));
		// TODO what is the end position for a method reference? the name or the last arg?
		return true;
	}
	return false;
}