/** * Get the mime type of the script. This will determine the script * interpreter to use. * * @return mime type of script */ public String getScriptMimeType() { return configurationParameters.getStringOrFail(KEY_SCRIPT_MIME_TYPE); }
/** * Get the boolean value of an entry given its key or fail with an exception * if it does not. * * @param key key * @return boolean entry value * @throws MultiMapException if no such entry exists */ public final Boolean getBooleanOrFail(String key) { String value = getStringOrFail(key); return Boolean.valueOf(value); }
protected String getContent(String key) throws IOException { String content = configurationParameters.getStringOrFail(key); if (content.startsWith("// res://")) { return IOUtil.getStringFromResource(this.getClass(), content.substring(3)); } return content; }
protected String getContent(String key) throws IOException { String content = configurationParameters.getStringOrFail(key); if (content.startsWith("// res://")) { return IOUtil.getStringFromResource(this.getClass(), content.substring(3)); } return content; }
/** * Get the boolean value of an entry given its key or fail with an exception * if it does not. * * @param key key * @return boolean entry value * @throws MultiMapException if no such entry exists */ public final Integer getIntegerOrFail(String key) { try { String value = getStringOrFail(key); return Integer.valueOf(value); } catch (NumberFormatException nfe) { throw new MultiMapException("Unable to obtain Integer value for key '" + key + "'.", nfe); } }
/** * Creates a <tt>Connector</tt> instance from the supplied configuration * parameters. * * @param configurationParameters the configuration parameters object * @return a <tt>Connector</tt> built from the supplied configuration * parameters * @throws ConnectorException on any exception */ public final Connector buildConnector(ConnectorConfigurationParameters configurationParameters) throws ConnectorException { String connectionClass = configurationParameters.getConfigurationParameters().getStringOrFail(CONNECTOR_CLASS); Connector connector = (Connector) createClassInstance(connectionClass, new Class[] {}, new Object[] {}); connector.open(configurationParameters); return connector; }
/** * Creates a <tt>Connector</tt> instance from the supplied configuration * parameters. * * @param configurationParameters the configuration parameters used to build * the <tt>Connector</tt> * @return a <tt>Connector</tt> built from the supplied configuration * parameters * @throws ConnectorException on any exception */ public final Connector buildConnector(MultiMap configurationParameters) throws ConnectorException { ConnectorConfigurationParameters connectorConfigurationParameters = buildConfiguration(configurationParameters); String connectionClass = configurationParameters.getStringOrFail(CONNECTOR_CLASS); Connector connector = (Connector) createClassInstance(connectionClass, new Class[] {}, new Object[] {}); connector.open(connectorConfigurationParameters); return connector; }