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 471e69930ca..6ac026fcbf4 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 b3fe5185c19..7845f1268b6 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 c4b4cc5dece..cd51a4895c4 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 ecee54016c2..417512a71ef 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 32ba8eb0f5b..a916a3baec3 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 8e452d00c99..7e86f1a700e 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 8b2feda1481..a9e7f84df6b 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 4733ef89d9c..d11bee12ace 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 3f5e82ab58e..96167d24ec7 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 e605f2e7908..5f65e056f61 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 c2da24872bb..1afd2eafe3c 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 9a3ba369028..e104e7b4663 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 2a5bfc77a9e..6aa94facb25 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 c78d8193ab6..808168de687 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 5d3621fe3f9..f3676ba5b8e 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 71bbbad39ed..496c3d7c9fc 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 049c7fde5f7..28cc9f5b535 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 c231561fc91..91f97e0a1dd 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 0007e7ef703..94e361edf0b 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 9fa33e73ed4..0342d3b2cb7 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 9011c372967..9772ff4ae46 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 7ce9e2ecde1..fefc10ffc88 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 88a13a84b60..fe9ee5c5af8 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 216f6d53ed3..02f8c43a289 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 0ba3be26ec1..b8c955e6f13 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 cdf9896fe32..7385c817166 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