1 24 package org.ofbiz.minilang.operation; 25 26 import java.util.*; 27 28 import org.w3c.dom.*; 29 import org.ofbiz.base.util.*; 30 31 38 public class PropertyOper extends MakeInStringOperation { 39 40 public static final String module = PropertyOper.class.getName(); 41 42 String resource; 43 String property; 44 45 public PropertyOper(Element element) { 46 super(element); 47 resource = element.getAttribute("resource"); 48 property = element.getAttribute("property"); 49 } 50 51 public String exec(Map inMap, List messages, Locale locale, ClassLoader loader) { 52 String propStr = UtilProperties.getPropertyValue(UtilURL.fromResource(resource, loader), property); 53 54 if (propStr == null || propStr.length() == 0) { 55 Debug.logWarning("[SimpleMapProcessor.PropertyOper.exec] Property " + property + " in resource " + resource + " not found, not appending anything", module); 56 return null; 57 } else { 58 return propStr; 59 } 60 } 61 } 62 | Popular Tags |