+ // check if we do not refer to a bean
+ int lastInd = key.lastIndexOf('.');
+ if (applicationContext != null && lastInd > 0) {
+ String beanName = key.substring(0, lastInd);
+ String propertyName = key.substring(lastInd + 1);
+ if (applicationContext.containsBean(beanName)) {
+ BeanWrapper beanWrapper = new BeanWrapperImpl(
+ applicationContext.getBean(beanName));
+ if (!beanWrapper.isReadableProperty(propertyName))
+ throw new SlcException("No readable property "
+ + propertyName + " in bean " + beanName);
+ Object obj = beanWrapper.getPropertyValue(propertyName);
+ return obj;
+ }
+ }
+
+ Object value = variables.get(key);
+ // try system property in last resort
+ if (value == null)
+ value = System.getProperty(key);
+ return value;