ValueParser ret = new ValueParser(values);
/** * Returns the supplied URL rendered as a String. * * @param url the URL to import * @return the URL as a string */ public String fetch(String url) { if (url == null || url.length() == 0) { return null; } try { if (importSupport == null) { initializeImportSupport(new ValueParser()); } return importSupport.acquireString(url); } catch (Exception ex) { getLog().error("Exception while acquiring '{}'", url, ex); return null; } }
/** * Returns the supplied resource rendered as a String. * * @param resource the URL to import * @return the URL as a string */ public String read(String resource) { if (resource == null || resource.length() == 0) { return null; } try { if (importSupport == null) { initializeImportSupport(new ValueParser()); } return importSupport.getResourceString(resource); } catch (Exception ex) { getLog().error("Exception while getting '{}'", resource, ex); return null; } }
initializeImportSupport(new ValueParser());
initializeImportSupport(new ValueParser());
initializeImportSupport(new ValueParser());
initializeImportSupport(new ValueParser());
/** * If {@link #isConfigLocked} returns {@code true}, then this method * does nothing; otherwise, if {@code false}, this will create a new * {@link ValueParser} from the specified Map of params and call * {@link #configure(ValueParser)} with it. Then this will check * the parameters itself to find out whether or not the configuration * for this tool should be put into safe mode or have its config locked. * The safe mode value should be a boolean under the key * {@link #SAFE_MODE_KEY} and the lock value should be a boolean * under the key {@link #LOCK_CONFIG_KEY}. * @param params configuration values map */ public void configure(Map params) { if (!isConfigLocked()) { ValueParser values = new ValueParser(params); // set up logger initLogger(values); // call configure configure(values); setSafeMode(values.getBoolean(SAFE_MODE_KEY, true)); // check under the new key Boolean lock = values.getBoolean(LOCK_CONFIG_KEY, Boolean.TRUE); setLockConfig(lock.booleanValue()); } }