Merge branch '2.3.x'
This commit is contained in:
@@ -3,20 +3,17 @@
|
||||
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
|
||||
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
<classpathentry kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/easymock/easymock/2.5.2/easymock-2.5.2.jar" sourcepath="M2_REPO/org/easymock/easymock/2.5.2/easymock-2.5.2-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/jboss/el/jboss-el/2.0.1.GA/jboss-el-2.0.1.GA.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/joda-time/joda-time/1.6/joda-time-1.6.jar" sourcepath="M2_REPO/joda-time/joda-time/1.6/joda-time-1.6-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar" sourcepath="M2_REPO/junit/junit/3.8.2/junit-3.8.2-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/ognl/ognl/2.6.9/ognl-2.6.9.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE-sources.jar"/>
|
||||
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-test/3.0.5.RELEASE/spring-test-3.0.5.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-test/3.0.5.RELEASE/spring-test-3.0.5.RELEASE-sources.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/javax.el/com.springsource.javax.el/1.0.0/com.springsource.javax.el-1.0.0.jar" sourcepath="/IVY_CACHE/javax.el/com.springsource.javax.el/1.0.0/com.springsource.javax.el-sources-1.0.0.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar" sourcepath="/IVY_CACHE/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-sources-1.1.1.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.apache.log4j/com.springsource.org.apache.log4j/1.2.15/com.springsource.org.apache.log4j-1.2.15.jar" sourcepath="/IVY_CACHE/org.apache.log4j/com.springsource.org.apache.log4j/1.2.15/com.springsource.org.apache.log4j-sources-1.2.15.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.easymock/com.springsource.org.easymock/2.5.2/com.springsource.org.easymock-2.5.2.jar" sourcepath="/IVY_CACHE/org.easymock/com.springsource.org.easymock/2.5.2/com.springsource.org.easymock-sources-2.5.2.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.jboss.el/com.springsource.org.jboss.el/2.0.0.GA/com.springsource.org.jboss.el-2.0.0.GA.jar" sourcepath="/IVY_CACHE/org.jboss.el/com.springsource.org.jboss.el/2.0.0.GA/com.springsource.org.jboss.el-sources-2.0.0.GA.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.jboss.javassist/com.springsource.javassist/3.3.0.ga/com.springsource.javassist-3.3.0.ga.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.junit/com.springsource.junit/3.8.2/com.springsource.junit-3.8.2.jar" sourcepath="/IVY_CACHE/org.junit/com.springsource.junit/3.8.2/com.springsource.junit-sources-3.8.2.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.beans/3.1.1.RELEASE/org.springframework.beans-3.1.1.RELEASE.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.beans/3.1.1.RELEASE/org.springframework.beans-sources-3.1.1.RELEASE.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.context/3.1.1.RELEASE/org.springframework.context-3.1.1.RELEASE.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.context/3.1.1.RELEASE/org.springframework.context-sources-3.1.1.RELEASE.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.core/3.1.1.RELEASE/org.springframework.core-3.1.1.RELEASE.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.core/3.1.1.RELEASE/org.springframework.core-sources-3.1.1.RELEASE.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.expression/3.1.1.RELEASE/org.springframework.expression-3.1.1.RELEASE.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.expression/3.1.1.RELEASE/org.springframework.expression-sources-3.1.1.RELEASE.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.ognl/com.springsource.org.ognl/2.6.9/com.springsource.org.ognl-2.6.9.jar" sourcepath="/IVY_CACHE/org.ognl/com.springsource.org.ognl/2.6.9/com.springsource.org.ognl-sources-2.6.9.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
</classpath>
|
||||
@@ -23,10 +23,10 @@
|
||||
<dependency org="javax.el" name="com.springsource.javax.el" rev="1.0.0" conf="provided->runtime"/>
|
||||
<dependency org="org.apache.commons" name="com.springsource.org.apache.commons.logging" rev="1.1.1" conf="compile->runtime"/>
|
||||
<dependency org="org.ognl" name="com.springsource.org.ognl" rev="2.6.9" conf="optional->runtime"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="3.0.5.RELEASE" conf="compile->runtime"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="3.0.5.RELEASE" conf="compile->runtime"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="3.0.5.RELEASE" conf="compile->runtime"/>
|
||||
<dependency org="org.springframework" name="org.springframework.expression" rev="3.0.5.RELEASE" conf="compile->runtime"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="3.1.1.RELEASE" conf="compile->runtime"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="3.1.1.RELEASE" conf="compile->runtime"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="3.1.1.RELEASE" conf="compile->runtime"/>
|
||||
<dependency org="org.springframework" name="org.springframework.expression" rev="3.1.1.RELEASE" conf="compile->runtime"/>
|
||||
|
||||
<!-- test-time only dependencies -->
|
||||
<dependency org="org.apache.log4j" name="com.springsource.org.apache.log4j" rev="1.2.15" conf="test->runtime"/>
|
||||
|
||||
@@ -125,6 +125,6 @@
|
||||
</testResources>
|
||||
</build>
|
||||
<properties>
|
||||
<spring.version>3.0.5.RELEASE</spring.version>
|
||||
<spring.version>3.1.1.RELEASE</spring.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.binding.message;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.core.style.ToStringCreator;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* An object of communication that provides text information. For example, a validation message may inform a web
|
||||
@@ -49,7 +50,8 @@ public class Message implements Serializable {
|
||||
|
||||
/**
|
||||
* A reference to the source element this message is associated with. This could be a field on a form in UI, or null
|
||||
* if the message is not associated with a any particular element.
|
||||
* (or empty "" in the case of global bean validation) if the message is not associated with a any particular
|
||||
* element.
|
||||
* @return the source
|
||||
*/
|
||||
public Object getSource() {
|
||||
@@ -72,6 +74,18 @@ public class Message implements Serializable {
|
||||
return severity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the message is associated with a field.
|
||||
* @return {@code true} if the source is a String that has text; {@code false} otherwise.
|
||||
*/
|
||||
public boolean hasField() {
|
||||
if (this.source instanceof String) {
|
||||
return StringUtils.hasText((String) this.source);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringCreator(this).append("source", source).append("severity", severity).append("text", text)
|
||||
.toString();
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<p>
|
||||
The Spring Data Binding framework, an internal library used by Spring Web Flow.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -107,8 +107,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase {
|
||||
public void testParseBeanEvalExpressionInvalidELVariable() {
|
||||
try {
|
||||
String expressionString = "bogus";
|
||||
Expression exp = parser.parseExpression(expressionString, new FluentParserContext()
|
||||
.evaluate(TestBean.class));
|
||||
Expression exp = parser.parseExpression(expressionString,
|
||||
new FluentParserContext().evaluate(TestBean.class));
|
||||
exp.getValue(new TestBean());
|
||||
fail("Should have failed");
|
||||
} catch (EvaluationException e) {
|
||||
@@ -131,8 +131,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase {
|
||||
|
||||
public void testParseTemplateExpressionWithVariables() {
|
||||
String expressionString = "#{value}#{#max}";
|
||||
Expression exp = parser.parseExpression(expressionString, new FluentParserContext().template().variable(
|
||||
new ExpressionVariable("max", "maximum")));
|
||||
Expression exp = parser.parseExpression(expressionString,
|
||||
new FluentParserContext().template().variable(new ExpressionVariable("max", "maximum")));
|
||||
TestBean target = new TestBean();
|
||||
assertEquals("foo2", exp.getValue(target)); // TODO:
|
||||
}
|
||||
@@ -147,7 +147,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase {
|
||||
String expressionString = "maximum";
|
||||
Expression exp = parser.parseExpression(expressionString, null);
|
||||
TestBean context = new TestBean();
|
||||
assertEquals(int.class, exp.getValueType(context));
|
||||
Class clazz = exp.getValueType(context);
|
||||
assertTrue(int.class.equals(clazz) || Integer.class.equals(clazz));
|
||||
}
|
||||
|
||||
public void testGetValueWithCoersion() {
|
||||
@@ -159,8 +160,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase {
|
||||
|
||||
public void testGetValueCoersionError() {
|
||||
String expressionString = "maximum";
|
||||
Expression exp = parser.parseExpression(expressionString, new FluentParserContext()
|
||||
.expectResult(TestBean.class));
|
||||
Expression exp = parser.parseExpression(expressionString,
|
||||
new FluentParserContext().expectResult(TestBean.class));
|
||||
TestBean context = new TestBean();
|
||||
try {
|
||||
exp.getValue(context);
|
||||
@@ -202,8 +203,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase {
|
||||
}
|
||||
|
||||
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
|
||||
return new TypedValue("Custom resolver resolved this special property!", TypeDescriptor
|
||||
.valueOf(String.class));
|
||||
return new TypedValue("Custom resolver resolved this special property!",
|
||||
TypeDescriptor.valueOf(String.class));
|
||||
}
|
||||
|
||||
public Class[] getSpecificTargetClasses() {
|
||||
|
||||
@@ -6,7 +6,7 @@ Import-Package:
|
||||
ognl;version="[2.6.9, 3.0.0)";resolution:=optional,
|
||||
org.jboss.el;version="[2.0.0, 3.0.0)";resolution:=optional
|
||||
Import-Template:
|
||||
org.springframework.*;version="[3.0.5.RELEASE, 3.1.0)",
|
||||
org.springframework.*;version="[3.1.0.RELEASE, 3.2.0)",
|
||||
org.apache.commons.logging;version="[1.1.1, 2.0.0)",
|
||||
javax.el;version="[1.0.0, 2.0.0)";resolution:=optional,
|
||||
ognl;version="[2.6.9, 3.0.0)";resolution:=optional,
|
||||
|
||||
Reference in New Issue
Block a user