Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2004-2008 the original author or authors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.springframework.binding.method;
A named method parameter. Each parameter has an identifying name and is of a specified type (class).

Keith Donald
public class Parameter {

The class of the parameter, e.g "springbank.AccountNumber".
	private Class type;

The name of the parameter as an evaluatable expression, e.g "accountNumber".
	private Expression name;

Create a new named parameter definition. Named parameters are capable of resolving parameter values (arguments) from argument sources.

type the parameter type, may be null
name the name the method argument expression (required)
	public Parameter(Class typeExpression name) {
		Assert.notNull(name"The parameter name expression is required");
		this. = type;
		this. = name;

Returns the parameter type. Could be null if no parameter type was specified.
	public Class getType() {
		return ;

Returns the parameter name.
	public Expression getName() {
		return ;

Evaluate this method parameter against the provided argument source, returning a single method argument value.

argumentSource the method argument source
the method argument value
	public Object evaluateArgument(Object argumentSource) {
		return .getValue(argumentSource);
	public boolean equals(Object obj) {
		if (!(obj instanceof Parameter)) {
			return false;
		Parameter other = (Parameterobj;
		return ObjectUtils.nullSafeEquals(other.type) && .equals(;
	public int hashCode() {
		return ( != null ? .hashCode() : 0) + .hashCode();
	public String toString() {
		return new ToStringCreator(this).append("type").append("name").toString();
New to GrepCode? Check out our FAQ X