1 25 28 package classycle.dependency; 29 30 import java.util.HashMap ; 31 import java.util.Map ; 32 33 final class DependencyProperties { 34 private final Map _defaultProperties; 35 private final Map _properties = new HashMap (); 36 37 DependencyProperties() 38 { 39 this(new HashMap ()); 40 } 41 42 DependencyProperties(Map defaultProperties) 43 { 44 _defaultProperties = defaultProperties; 45 } 46 47 String getProperty(String name) 48 { 49 String result = (String ) _properties.get(name); 50 if (result == null) 51 { 52 Object value = _defaultProperties.get(name); 53 if (value instanceof String ) 54 { 55 result = (String ) value; 56 } 57 } 58 return result; 59 } 60 61 void setProperty(String name, String value) 62 { 63 _properties.put(name, value); 64 } 65 } | Popular Tags |