/** * Merge the given Properties instance into the given Map, * copying all properties (key-value pairs) over. * <p>Uses {@code Properties.propertyNames()} to even catch * default properties linked into the original Properties instance. * @param props the Properties instance to merge (may be {@code null}) * @param map the target Map to merge the properties into */ @SuppressWarnings("unchecked") public static <K, V> void mergePropertiesIntoMap(@Nullable Properties props, Map<K, V> map) { if (props != null) { for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); Object value = props.get(key); if (value == null) { // Allow for defaults fallback or potentially overridden accessor... value = props.getProperty(key); } map.put((K) key, (V) value); } } }
public Settings merge(Properties properties) { if (properties == null || properties.isEmpty()) { return this; } Enumeration<?> propertyNames = properties.propertyNames(); Object prop = null; for (; propertyNames.hasMoreElements();) { prop = propertyNames.nextElement(); if (prop instanceof String) { Object value = properties.get(prop); setProperty((String) prop, value.toString()); } } return this; }
/** Creates a new instance of LocalStringsManager from the properties Vector */ public LocalStringsManager(Vector<Properties> localizePropertiesList) { this.packageName = null; this.propertyFile = null; for (int i = 0; i < localizePropertiesList.size(); i++) { Properties properties = localizePropertiesList.get(i); String packageNameStr = (String) properties.get("base-package"); String propertyFileStr = (String) properties.get("property-file-name"); ResourceBundle resourceBundle = ResourceBundle.getBundle(packageNameStr + "." + propertyFileStr); resourceBundles.add(resourceBundle); } }
_call.setUsername(super.cachedUsername); _call.setTimeout(super.cachedTimeout); java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); for (int i = 0; i < cachedSerFactories.size(); ++i) { java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames.get(i); java.lang.Object x = cachedSerFactories.get(i); if (x instanceof Class) { java.lang.Class sf = (java.lang.Class)
_call.setUsername(super.cachedUsername); _call.setTimeout(super.cachedTimeout); java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key));
public static Properties interpolateVariables(Properties properties, Map<String, String> variables) { Properties result = new Properties(); Enumeration keys = properties.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); String value = (String) properties.get(key); String interpolatedValue = StrSubstitutor.replace(value, variables, "${env:", "}"); result.setProperty(key, interpolatedValue); } return result; }
_call.setUsername(super.cachedUsername); _call.setTimeout(super.cachedTimeout); java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); for (int i = 0; i < cachedSerFactories.size(); ++i) { java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames.get(i); java.lang.Object x = cachedSerFactories.get(i); if (x instanceof Class) { java.lang.Class sf = (java.lang.Class)
while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); sb.append(key); sb.append('='); Properties def = defaults; while (property == null) { property = (String) def.get(key); def = def.defaults;
_call.setUsername(super.cachedUsername); _call.setTimeout(super.cachedTimeout); Enumeration<Object> keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key));
void initializeMaterials() { if(materials==null) materials=new Vector(); String list=(String)parameters.get("MaterialList"); if(list==null) { list=""; for(int i=0;i<materials.size();i++) list+=(i>0?",":"")+(String)materials.get(i); parameters.put("MaterialList",list); } else { materials.clear(); StringTokenizer t=new StringTokenizer(list,","); while(t.hasMoreTokens()) materials.add(t.nextToken()); } }
/** * Merge the given Properties instance into the given Map, * copying all properties (key-value pairs) over. * <p>Uses {@code Properties.propertyNames()} to even catch * default properties linked into the original Properties instance. * @param props the Properties instance to merge (may be {@code null}) * @param map the target Map to merge the properties into */ @SuppressWarnings("unchecked") public static <K, V> void mergePropertiesIntoMap(@Nullable Properties props, Map<K, V> map) { if (props != null) { for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); Object value = props.get(key); if (value == null) { // Allow for defaults fallback or potentially overridden accessor... value = props.getProperty(key); } map.put((K) key, (V) value); } } }
_call.setUsername(super.cachedUsername); _call.setTimeout(super.cachedTimeout); java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); for (int i = 0; i < cachedSerFactories.size(); ++i) { java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames.get(i); java.lang.Object x = cachedSerFactories.get(i); if (x instanceof Class) { java.lang.Class sf = (java.lang.Class)
while(nics.hasMoreElements()) { Enumeration<?> rawAdrs = ((NetworkInterface)nics.nextElement()).getInetAddresses(); while(rawAdrs.hasMoreElements()) { InetAddress inet = (InetAddress) rawAdrs.nextElement(); ips.add(StringUtils.simpleHostname(inet.getHostName())); ips.add(inet.getHostAddress()); String dataDirStr = properties.get("dataDir").toString().trim(); File dataDir = new File(dataDirStr); if (!dataDir.isDirectory()) {
/** * Merge the given Properties instance into the given Map, * copying all properties (key-value pairs) over. * <p>Uses <code>Properties.propertyNames()</code> to even catch * default properties linked into the original Properties instance. * @param props the Properties instance to merge (may be <code>null</code>) * @param map the target Map to merge the properties into */ @SuppressWarnings("unchecked") public static void mergePropertiesIntoMap(Properties props, Map map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } if (props != null) { for (Enumeration en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); Object value = props.getProperty(key); if (value == null) { // Potentially a non-String value... value = props.get(key); } map.put(key, value); } } }
_call.setUsername(super.cachedUsername); _call.setTimeout(super.cachedTimeout); java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); for (int i = 0; i < cachedSerFactories.size(); ++i) { java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames.get(i); java.lang.Object x = cachedSerFactories.get(i); if (x instanceof Class) { java.lang.Class sf = (java.lang.Class)
while (names.hasMoreElements()) { String name = (String) names.nextElement(); String value = (String) _properties.get(name);
public static void mergePropertiesIntoMap(Properties props, Map map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } else { String key; Object value; if (props != null) { for (Enumeration en = props.propertyNames(); en.hasMoreElements(); map.put(key, value)) { key = (String) en.nextElement(); value = props.getProperty(key); if (value == null) { value = props.get(key); } } } } }
_call.setUsername(super.cachedUsername); _call.setTimeout(super.cachedTimeout); java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); for (int i = 0; i < cachedSerFactories.size(); ++i) { java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames.get(i); java.lang.Object x = cachedSerFactories.get(i); if (x instanceof Class) { java.lang.Class sf = (java.lang.Class)
while (names.hasMoreElements()) { String name = (String) names.nextElement(); String value = (String) _properties.get(name);
/** * Merge the given Properties instance into the given Map, * copying all properties (key-value pairs) over. * <p>Uses {@code Properties.propertyNames()} to even catch * default properties linked into the original Properties instance. * @param props the Properties instance to merge (may be {@code null}) * @param map the target Map to merge the properties into */ @SuppressWarnings("unchecked") public static <K, V> void mergePropertiesIntoMap(Properties props, Map<K, V> map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } if (props != null) { for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); Object value = props.get(key); if (value == null) { // Allow for defaults fallback or potentially overridden accessor... value = props.getProperty(key); } map.put((K) key, (V) value); } } }