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
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.binding.expression;
An expression variable.

Author(s):
Keith Donald
public class ExpressionVariable {
	private String name;
Creates a new expression variable.

Parameters:
name the name of the variable, acting as an convenient alias (required)
valueExpression the value expression (required)
	public ExpressionVariable(String nameString valueExpression) {
		init(namevalueExpressionnull);
	}

Creates a new expression variable with a populated parser context.

Parameters:
name the name of the variable, acting as an convenient alias (required)
valueExpression the value expression (required)
parserContext the parser context to use to parse the value expression (optional)
	public ExpressionVariable(String nameString valueExpressionParserContext parserContext) {
		init(namevalueExpressionparserContext);
	}

Returns the variable name.

Returns:
the variable name
	public String getName() {
		return ;
	}

Returns the expression that will be evaluated when the variable is referenced by its name in another expression.

Returns:
the expression value.
	}

Returns the parser context to use to parse the variable's value expression.

Returns:
the value expression parser context
		return ;
	}
	public boolean equals(Object o) {
		if (!(o instanceof ExpressionVariable)) {
			return false;
		}
		return .equals(var.name);
	}
	public int hashCode() {
		return .hashCode();
	}
	public String toString() {
		return "[Expression Variable '" +  + "']";
	}
	private void init(String nameString valueExpressionParserContext parserContext) {
		Assert.hasText(name"The expression variable must be named");
		Assert.hasText(valueExpression"The expression variable's value expression is required");
		this. = name;
		this. = valueExpression;
		this. = parserContext;
	}
New to GrepCode? Check out our FAQ X