public void unsetProperty(String string) { getProperties().remove(string); }
public void unsetProperty(String string) { getProperties().remove(string); }
/** * Add or override a new property. * * @param key * @param value */ public void setProperty(String key, String value) { checkheader: for (int i = 0; i < headers.length; i++) { if (headers[i].equalsIgnoreCase(value)) { value = headers[i]; break checkheader; } } getProperties().put(key, value); }
/** * Add or override a new property. * * @param key * @param value */ public void setProperty(String key, String value) { checkheader: for (int i = 0; i < headers.length; i++) { if (headers[i].equalsIgnoreCase(value)) { value = headers[i]; break checkheader; } } getProperties().put(key, value); }
public void mergeProperties(Properties properties, boolean override) { for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements();) { String key = (String) e.nextElement(); String value = properties.getProperty(key); if (override || !getProperties().containsKey(key)) setProperty(key, value); } }
public void mergeProperties(Properties properties, boolean override) { for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements();) { String key = (String) e.nextElement(); String value = properties.getProperty(key); if (override || !getProperties().containsKey(key)) setProperty(key, value); } }
/** * Take all the properties and translate them to actual values. This method * takes the set properties and traverse them over all entries, including * the default properties for that properties. The values no longer contain * macros. * * @return A new Properties with the flattened values */ public Properties getFlattenedProperties() { // Some macros only work in a lower processor, so we // do not report unknown macros while flattening flattening = true; try { Properties flattened = new Properties(); Properties source = domain.getProperties(); for (Enumeration<?> e = source.propertyNames(); e.hasMoreElements();) { String key = (String) e.nextElement(); if (!key.startsWith("_")) if (key.startsWith("-")) flattened.put(key, source.getProperty(key)); else flattened.put(key, process(source.getProperty(key))); } return flattened; } finally { flattening = false; } };
public Macro getReplacer() { if (replacer == null) return replacer = new Macro(getProperties(), this, getMacroDomains()); else return replacer; }
/** * Get a property with a proper default * * @param headerName * @param deflt * @return */ public String getProperty(String key, String deflt) { String value; if (filter != null && filter.contains(key)) { value = (String) getProperties().get(key); } else value = getProperties().getProperty(key); if (value != null) return getReplacer().process(value); else if (deflt != null) return getReplacer().process(deflt); else return null; }
/** * Get a property with a proper default * * @param headerName * @param deflt * @return */ public String getProperty(String key, String deflt) { String value = null; Processor source = this; if (filter != null && filter.contains(key)) { value = (String) getProperties().get(key); } else { while (source != null) { value = (String) source.getProperties().get(key); if (value != null) break; source = source.getParent(); } } if (value != null) return getReplacer().process(value, source); else if (deflt != null) return getReplacer().process(deflt, this); else return null; }
String value = null; while( source != null) { value = source.getProperties().getProperty(key); if ( value != null ) break;