diff --git a/org.springframework.aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java b/org.springframework.aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java index 471e69930cae4c795b29a550b2cc0f2588d51b50..6ac026fcbf4a8a39e2a20ba3d3c7631298e3a162 100644 --- a/org.springframework.aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java +++ b/org.springframework.aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java @@ -5,7 +5,7 @@ * 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 + * 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, diff --git a/org.springframework.aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java b/org.springframework.aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java index b3fe5185c194edb36cafcf7c19d8c9483ce42a8c..7845f1268b67b1df051c3c5a0e9c5db1e4591490 100644 --- a/org.springframework.aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java +++ b/org.springframework.aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java @@ -5,7 +5,7 @@ * 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 + * 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, diff --git a/org.springframework.aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java b/org.springframework.aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java index c4b4cc5dece214b8c7ad752d4f830e92d0cdeba9..cd51a4895c4b1be1d3110ca067d9c27f951227b0 100644 --- a/org.springframework.aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java +++ b/org.springframework.aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java @@ -5,7 +5,7 @@ * 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 + * 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, diff --git a/org.springframework.context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java b/org.springframework.context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java index ecee54016c26f16bfb5308f2923542f9ddd3044d..417512a71ef225991e3cb6498131b523fa36b7ad 100644 --- a/org.springframework.context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java +++ b/org.springframework.context/src/test/java/org/springframework/aop/config/AopNamespaceHandlerProxyTargetClassTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests.java b/org.springframework.context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests.java index 32ba8eb0f5b8df7ac78545c82481a16a3728ba1d..a916a3baec3b41348e442be54bf7c37075e9ec87 100644 --- a/org.springframework.context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests.java +++ b/org.springframework.context/src/test/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationTests.java @@ -5,7 +5,7 @@ * 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 + * 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, diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java index 8e452d00c99e1b75af4adc1b0a090a3cd8ffd37f..7e86f1a700e40d6145dbdf3eb3dfe31c80b682a8 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/CustomEditorConfigurerTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/DateRange.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/DateRange.java index 8b2feda148119e42072f73cae7bc77257295bcd6..a9e7f84df6b8e2c55fce20a3c689c1385e37d3d9 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/DateRange.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/DateRange.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java index 4733ef89d9c7a7a8c7cdc09dd8c474d55be301bc..d11bee12ace6a6c169a47b9f896a34a3b42f36c0 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/ExceptionOnInitBean.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java index 3f5e82ab58e6de02f6940eb869f34f9b841fc20a..96167d24ec79e00859e9baeb5b750cdda5967a53 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/PropertyPlaceholderConfigurerTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java index e605f2e7908a5785a0463a607139eedeaaeed6ee..5f65e056f614f28b9cfd927b12932a646704e047 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/annotation/AnnotationMetadataAssemblerTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java index c2da24872bb1bc32588f227dae1538e86f340ebc..1afd2eafe3c1134bae70e37d8903d7f83fd5ba0f 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractAutodetectTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java index 9a3ba369028313ba7fa953233d68302ce766a80b..e104e7b4663f2a5e6e1d41be2d5c0f33ec65d36e 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java index 2a5bfc77a9e47b498067209212ac470332aa1b78..6aa94facb2529b9489c96fb4168c22ebf2f72df7 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerAutodetectTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java index c78d8193ab6e4b57c0fd07f8b6d0b57bb1403272..808168de68760841e66387af4ab98ebdbeb47d38 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ICustomBase.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java index 5d3621fe3f96c8bbf780f4558779faad25411030..f3676ba5b8ed08f2eac8fecda9cd6f80df305ec9 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ICustomJmxBean.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java index 71bbbad39ed6cdb928bf4b273dd3bb68221c6abe..496c3d7c9fcda5f82ee28d9c19ca6312c31fea66 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerMappedTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java index 049c7fde5f7e9a06b39f4f73ae76a9e47847d1a0..28cc9f5b5350dd0b08ed5444e627243f6c8dc6a8 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssemblerTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java index c231561fc91e306d8a1582a79610074c83196155..91f97e0a1dd224bba6aaef940f19a5d62d54e80f 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/assembler/ReflectiveAssemblerTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java index 0007e7ef703823cf643f2e02dc3ea7860594a0b5..94e361edf0b3ab9eae8ea1c7b1827fae7d78e4a1 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/AbstractNamingStrategyTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java index 9fa33e73ed4f7c540dbbdbeedac87c185ad142bd..0342d3b2cb7597343c52446f51a2a8a5c67e5658 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/KeyNamingStrategyTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java index 9011c3729672163a0fe45e9049e22e3eef515c47..9772ff4ae469a8f74314345a96b0a8ce4df80843 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/PropertiesFileNamingStrategyTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java b/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java index 7ce9e2ecde1bbb4b774166a66c75a6f37b822ac4..fefc10ffc88a122d144a199df3d09b3f630ec765 100644 --- a/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java +++ b/org.springframework.context/src/test/java/org/springframework/jmx/export/naming/PropertiesNamingStrategyTests.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/org.springframework.context/src/test/java/test/beans/CustomScope.java b/org.springframework.context/src/test/java/test/beans/CustomScope.java index 88a13a84b60f4b194b57d4f3ddc0b8feb220cf12..fe9ee5c5af812eb40731ed6b8122d60ddf482179 100644 --- a/org.springframework.context/src/test/java/test/beans/CustomScope.java +++ b/org.springframework.context/src/test/java/test/beans/CustomScope.java @@ -5,7 +5,7 @@ * 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 + * 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, diff --git a/org.springframework.core/src/main/java/org/springframework/core/env/AbstractEnvironment.java b/org.springframework.core/src/main/java/org/springframework/core/env/AbstractEnvironment.java index 216f6d53ed34dc550bc71a3765f267a819369122..02f8c43a289abbfed5b9572eb5e561ef38ba15f8 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/env/AbstractEnvironment.java +++ b/org.springframework.core/src/main/java/org/springframework/core/env/AbstractEnvironment.java @@ -5,7 +5,7 @@ * 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 + * 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, diff --git a/org.springframework.core/src/test/java/org/springframework/core/env/DefaultEnvironmentTests.java b/org.springframework.core/src/test/java/org/springframework/core/env/DefaultEnvironmentTests.java index 0ba3be26ec19d091310824e6015d7cad41eb9343..b8c955e6f1345efb0aeced9bf17c84b26f2b8cbc 100644 --- a/org.springframework.core/src/test/java/org/springframework/core/env/DefaultEnvironmentTests.java +++ b/org.springframework.core/src/test/java/org/springframework/core/env/DefaultEnvironmentTests.java @@ -5,7 +5,7 @@ * 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 + * 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, diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/common/TemplateAwareExpressionParser.java b/org.springframework.expression/src/main/java/org/springframework/expression/common/TemplateAwareExpressionParser.java index cdf9896fe3203084660215f9c09568db3658aa36..7385c817166433b2bdcc5dc246417996bc434804 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/common/TemplateAwareExpressionParser.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/common/TemplateAwareExpressionParser.java @@ -1 +1 @@ -/* * Copyright 2002-2009 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.expression.common; import java.util.LinkedList; import java.util.List; import java.util.Stack; import org.springframework.expression.Expression; import org.springframework.expression.ExpressionParser; import org.springframework.expression.ParseException; import org.springframework.expression.ParserContext; /** * An expression parser that understands templates. It can be subclassed * by expression parsers that do not offer first class support for templating. * * @author Keith Donald * @author Juergen Hoeller * @author Andy Clement * @since 3.0 */ public abstract class TemplateAwareExpressionParser implements ExpressionParser { /** * Default ParserContext instance for non-template expressions. */ private static final ParserContext NON_TEMPLATE_PARSER_CONTEXT = new ParserContext() { public String getExpressionPrefix() { return null; } public String getExpressionSuffix() { return null; } public boolean isTemplate() { return false; } }; public Expression parseExpression(String expressionString) throws ParseException { return parseExpression(expressionString, NON_TEMPLATE_PARSER_CONTEXT); } public Expression parseExpression(String expressionString, ParserContext context) throws ParseException { if (context == null) { context = NON_TEMPLATE_PARSER_CONTEXT; } if (context.isTemplate()) { return parseTemplate(expressionString, context); } else { return doParseExpression(expressionString, context); } } private Expression parseTemplate(String expressionString, ParserContext context) throws ParseException { if (expressionString.length() == 0) { return new LiteralExpression(""); } Expression[] expressions = parseExpressions(expressionString, context); if (expressions.length == 1) { return expressions[0]; } else { return new CompositeStringExpression(expressionString, expressions); } } /** * Helper that parses given expression string using the configured parser. The expression string can contain any * number of expressions all contained in "${...}" markers. For instance: "foo${expr0}bar${expr1}". The static * pieces of text will also be returned as Expressions that just return that static piece of text. As a result, * evaluating all returned expressions and concatenating the results produces the complete evaluated string. * Unwrapping is only done of the outermost delimiters found, so the string 'hello ${foo${abc}}' would break into * the pieces 'hello ' and 'foo${abc}'. This means that expression languages that used ${..} as part of their * functionality are supported without any problem. * The parsing is aware of the structure of an embedded expression. It assumes that parentheses '(', * square brackets '[' and curly brackets '}' must be in pairs within the expression unless they are within a * string literal and a string literal starts and terminates with a single quote '. * * @param expressionString the expression string * @return the parsed expressions * @throws ParseException when the expressions cannot be parsed */ private Expression[] parseExpressions(String expressionString, ParserContext context) throws ParseException { List expressions = new LinkedList(); String prefix = context.getExpressionPrefix(); String suffix = context.getExpressionSuffix(); int startIdx = 0; while (startIdx < expressionString.length()) { int prefixIndex = expressionString.indexOf(prefix,startIdx); if (prefixIndex >= startIdx) { // an inner expression was found - this is a composite if (prefixIndex > startIdx) { expressions.add(createLiteralExpression(context,expressionString.substring(startIdx, prefixIndex))); } int afterPrefixIndex = prefixIndex + prefix.length(); int suffixIndex = skipToCorrectEndSuffix(prefix,suffix,expressionString,afterPrefixIndex); if (suffixIndex == -1) { throw new ParseException(expressionString, prefixIndex, "No ending suffix '" + suffix + "' for expression starting at character " + prefixIndex + ": " + expressionString.substring(prefixIndex)); } if (suffixIndex == afterPrefixIndex) { throw new ParseException(expressionString, prefixIndex, "No expression defined within delimiter '" + prefix + suffix + "' at character " + prefixIndex); } else { String expr = expressionString.substring(prefixIndex + prefix.length(), suffixIndex); expr = expr.trim(); if (expr.length()==0) { throw new ParseException(expressionString, prefixIndex, "No expression defined within delimiter '" + prefix + suffix + "' at character " + prefixIndex); } expressions.add(doParseExpression(expr, context)); startIdx = suffixIndex + suffix.length(); } } else { // no more ${expressions} found in string, add rest as static text expressions.add(createLiteralExpression(context,expressionString.substring(startIdx))); startIdx = expressionString.length(); } } return expressions.toArray(new Expression[expressions.size()]); } private Expression createLiteralExpression(ParserContext context, String text) { return new LiteralExpression(text); } /** * Return true if the specified suffix can be found at the supplied position in the supplied expression string. * @param expressionString the expression string which may contain the suffix * @param pos the start position at which to check for the suffix * @param suffix the suffix string * @return */ private boolean isSuffixHere(String expressionString,int pos,String suffix) { int suffixPosition = 0; for (int i=0;i stack = new Stack(); while (pos expressions = new LinkedList(); String prefix = context.getExpressionPrefix(); String suffix = context.getExpressionSuffix(); int startIdx = 0; while (startIdx < expressionString.length()) { int prefixIndex = expressionString.indexOf(prefix,startIdx); if (prefixIndex >= startIdx) { // an inner expression was found - this is a composite if (prefixIndex > startIdx) { expressions.add(createLiteralExpression(context,expressionString.substring(startIdx, prefixIndex))); } int afterPrefixIndex = prefixIndex + prefix.length(); int suffixIndex = skipToCorrectEndSuffix(prefix,suffix,expressionString,afterPrefixIndex); if (suffixIndex == -1) { throw new ParseException(expressionString, prefixIndex, "No ending suffix '" + suffix + "' for expression starting at character " + prefixIndex + ": " + expressionString.substring(prefixIndex)); } if (suffixIndex == afterPrefixIndex) { throw new ParseException(expressionString, prefixIndex, "No expression defined within delimiter '" + prefix + suffix + "' at character " + prefixIndex); } else { String expr = expressionString.substring(prefixIndex + prefix.length(), suffixIndex); expr = expr.trim(); if (expr.length()==0) { throw new ParseException(expressionString, prefixIndex, "No expression defined within delimiter '" + prefix + suffix + "' at character " + prefixIndex); } expressions.add(doParseExpression(expr, context)); startIdx = suffixIndex + suffix.length(); } } else { // no more ${expressions} found in string, add rest as static text expressions.add(createLiteralExpression(context,expressionString.substring(startIdx))); startIdx = expressionString.length(); } } return expressions.toArray(new Expression[expressions.size()]); } private Expression createLiteralExpression(ParserContext context, String text) { return new LiteralExpression(text); } /** * Return true if the specified suffix can be found at the supplied position in the supplied expression string. * @param expressionString the expression string which may contain the suffix * @param pos the start position at which to check for the suffix * @param suffix the suffix string * @return */ private boolean isSuffixHere(String expressionString,int pos,String suffix) { int suffixPosition = 0; for (int i=0;i stack = new Stack(); while (pos