X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FExecutionParameterPostProcessor.java;h=2ba426e13ebd1fe0f411378c9a2941af5611cf1c;hb=bfb5bb54702d2e706ab7a8b0bc4af94eada6e01c;hp=e56bfd388fd2cb76f7a05f4db53572e4acda01da;hpb=9db6be2103ce521f8fd6d715c0f97b273a878928;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionParameterPostProcessor.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionParameterPostProcessor.java index e56bfd388..2ba426e13 100644 --- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionParameterPostProcessor.java +++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionParameterPostProcessor.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Mathieu Baudier + * + * 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.argeo.slc.core.execution; import java.beans.PropertyDescriptor; @@ -103,11 +119,15 @@ public class ExecutionParameterPostProcessor extends String originalValue = tsv.getValue(); String convertedValue = resolveString(beanName, bean, originalValue); + if (convertedValue == null) + return null; return convertedValue.equals(originalValue) ? value : new TypedStringValue(convertedValue); } else if (value instanceof String) { String originalValue = value.toString(); String convertedValue = resolveString(beanName, bean, originalValue); + if (convertedValue == null) + return null; return convertedValue.equals(originalValue) ? value : convertedValue; } else if (value instanceof ManagedMap) { @@ -165,6 +185,10 @@ public class ExecutionParameterPostProcessor extends } private String resolveString(String beanName, Object bean, String strVal) { + // in case is passed + if (strVal == null) + return null; + String value = parseStringValue(bean, strVal, new HashSet()); if (value == null) @@ -204,6 +228,10 @@ public class ExecutionParameterPostProcessor extends Set visitedPlaceholders) throws BeanDefinitionStoreException { + // in case is passed + if (strVal == null) + return null; + StringBuffer buf = new StringBuffer(strVal); int startIndex = strVal.indexOf(placeholderPrefix);