Index: java/org/apache/commons/httpclient/HttpClient.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v retrieving revision 1.83 diff -u -r1.83 HttpClient.java --- java/org/apache/commons/httpclient/HttpClient.java 17 Sep 2003 23:29:05 -0000 1.83 +++ java/org/apache/commons/httpclient/HttpClient.java 22 Sep 2003 10:10:01 -0000 @@ -121,13 +121,30 @@ // ----------------------------------------------------------- Constructors /** - * Creates an instance of HttpClient using the default connection manager. + * Creates an instance of HttpClient using default {@link HttpClientParams parameter set}. * - * @see HttpClientParams#getConnectionManagerClass() + * @see HttpClientParams */ public HttpClient() { + this(new HttpClientParams()); + } + /** + * Creates an instance of HttpClient using the given + * {@link HttpClientParams parameter set}. + * + * @param params The {@link HttpClientParams parameters} to use. + * + * @see HttpClientParams + * + * @since 2.1 + */ + public HttpClient(HttpClientParams params) { super(); + if (params == null) { + throw new IllegalArgumentException("Params may not be null"); + } + this.params = params; try { this.httpConnectionManager = (HttpConnectionManager) params.getConnectionManagerClass().newInstance(); @@ -140,21 +157,41 @@ } /** - * Creates an instance of HttpClient with a user specified connection manager. + * Creates an instance of HttpClient with a user specified + * {@link HttpClientParams parameter set} and + * {@link HttpConnectionManager HTTP connection manager}. + * + * @param params The {@link HttpClientParams parameters} to use. * @param httpConnectionManager The {@link HttpConnectionManager connection manager} * to use. * - * @since 2.0 + * @since 2.1 */ - public HttpClient(HttpConnectionManager httpConnectionManager) { - + public HttpClient(HttpClientParams params, HttpConnectionManager httpConnectionManager) { + super(); if (httpConnectionManager == null) { throw new IllegalArgumentException("httpConnectionManager cannot be null"); } - + if (params == null) { + throw new IllegalArgumentException("Params may not be null"); + } + this.params = params; this.httpConnectionManager = httpConnectionManager; } + /** + * Creates an instance of HttpClient with a user specified + * {@link HttpConnectionManager HTTP connection manager}. + * + * @param httpConnectionManager The {@link HttpConnectionManager connection manager} + * to use. + * + * @since 2.0 + */ + public HttpClient(HttpConnectionManager httpConnectionManager) { + this(new HttpClientParams(), httpConnectionManager); + } + // ----------------------------------------------------- Instance Variables /** @@ -168,7 +205,10 @@ */ private HttpState state = new HttpState(); - private HttpClientParams params = new HttpClientParams(); + /** + * The {@link HttpClientParams collection of parameters} associated with this HttpClient. + */ + private HttpClientParams params = null; /** * The {@link HostConfiguration host configuration} associated with Index: java/org/apache/commons/httpclient/params/DefaultHttpParams.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/DefaultHttpParams.java,v retrieving revision 1.2 diff -u -r1.2 DefaultHttpParams.java --- java/org/apache/commons/httpclient/params/DefaultHttpParams.java 17 Sep 2003 23:29:05 -0000 1.2 +++ java/org/apache/commons/httpclient/params/DefaultHttpParams.java 22 Sep 2003 10:10:01 -0000 @@ -63,28 +63,35 @@ package org.apache.commons.httpclient.params; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; import java.util.HashMap; +import java.util.Iterator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * This class represents a collection of HTTP protocol parameters. Protocol parameters - * may be linked together to form a hierarchy. A parameter may be off, on - * or not explicitly defined. If a parameter value has not been explicitly defined, - * its default value will be drawn from the upper level collection of parameters. - * + * may be linked together to form a hierarchy. If a particular parameter value has not been + * explicitly defined in the collection itself, its value will be drawn from the parent + * collection of parameters. + * * @author Oleg Kalnichevski * * @version $Revision: 1.2 $ * */ -public class DefaultHttpParams implements HttpParams { +public class DefaultHttpParams implements HttpParams, Serializable, Cloneable { /** Log object for this class. */ private static final Log LOG = LogFactory.getLog(DefaultHttpParams.class); + /** HttpParams class factory. */ private static HttpParamsFactory httpParamsFactory = new DefaultHttpParamsFactory(); /** @@ -115,28 +122,35 @@ /** The set of default values to defer to */ private HttpParams defaults = null; - /** Hash map of HTTP parameters that this object contains */ + /** Hash map of HTTP parameters that this collection contains */ private HashMap parameters = null; + /** + * Creates a new collection of parameters with the given parent. + * The collection will defer to its parent for a default value + * if a particular parameter is not explicitly set in the collection + * itself. + * + * @param defaults the parent collection to defer to, if a parameter + * is not explictly set in the collection itself. + */ public DefaultHttpParams(final HttpParams defaults) { super(); this.defaults = defaults; } /** - * Initializes this class with defaults set to the value returned from - * DefaultHttpParams.getDefaultParams(). - * + * Creates a new collection of parameters with the collection returned + * by {@link #getDefaultParams()} as a parent. The collection will defer + * to its parent for a default value if a particular parameter is not + * explicitly set in the collection itself. + * * @see #getDefaultParams() */ public DefaultHttpParams() { this(getDefaultParams()); } - /** - * Returns reference to - * - */ public synchronized HttpParams getDefaults() { return this.defaults; } @@ -176,14 +190,19 @@ } } + /** + * Assigns the value to all the parameter with the given names + * + * @param names array of parameter name + * @param value parameter value + */ public synchronized void setParameters(final String[] names, final Object value) { for (int i = 0; i < names.length; i++) { setParameter(names[i], value); } } - public long getLongParameter(final String name, long defaultValue) - throws ClassCastException { + public long getLongParameter(final String name, long defaultValue) { Object param = getParameter(name); if (param == null) { return defaultValue; @@ -195,8 +214,7 @@ setParameter(name, new Long(value)); } - public int getIntParameter(final String name, int defaultValue) - throws ClassCastException { + public int getIntParameter(final String name, int defaultValue) { Object param = getParameter(name); if (param == null) { return defaultValue; @@ -208,8 +226,7 @@ setParameter(name, new Integer(value)); } - public double getDoubleParameter(final String name, double defaultValue) - throws ClassCastException { + public double getDoubleParameter(final String name, double defaultValue) { Object param = getParameter(name); if (param == null) { return defaultValue; @@ -221,8 +238,7 @@ setParameter(name, new Double(value)); } - public boolean getBooleanParameter(final String name, boolean defaultValue) - throws ClassCastException { + public boolean getBooleanParameter(final String name, boolean defaultValue) { Object param = getParameter(name); if (param == null) { return defaultValue; @@ -239,6 +255,51 @@ } public boolean isParameterFalse(final String name) { - return !getBooleanParameter(name, true); + return !getBooleanParameter(name, false); } + + /** + * Removes all parameters from this collection. + */ + public void clear() { + this.parameters = null; + } + + /** + * Attempts to create a 'deep' clone of this collection of parameters. + * If a parameter is {@link java.io.Serializable serializable}, it + * will be copied by value, otherwise it will be copied by reference. + * + * @see java.io.Serializable + * @see java.lang.Object#clone() + */ + public Object clone() throws CloneNotSupportedException + { + // Sun, do somethig about java.lang.Cloneable + // It is just plain broken + DefaultHttpParams clone = (DefaultHttpParams)super.clone(); + if ((this.parameters != null) && (this.parameters.size() > 0)) { + clone.parameters = new HashMap(); + Iterator keys = this.parameters.keySet().iterator(); + while (keys.hasNext()) { + String key = (String)keys.next(); + Object param = this.parameters.get(key); + if (param instanceof Serializable) { + try { + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(buffer); + out.writeObject(param); + ObjectInputStream in = new ObjectInputStream( + new ByteArrayInputStream(buffer.toByteArray())); + param = in.readObject(); + } catch(Exception e) { + //Whatever happens, just ignore + } + } + clone.setParameter(key, param); + } + } + return clone; + } + } Index: java/org/apache/commons/httpclient/params/HttpClientParams.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/HttpClientParams.java,v retrieving revision 1.1 diff -u -r1.1 HttpClientParams.java --- java/org/apache/commons/httpclient/params/HttpClientParams.java 11 Sep 2003 20:08:33 -0000 1.1 +++ java/org/apache/commons/httpclient/params/HttpClientParams.java 22 Sep 2003 10:10:02 -0000 @@ -66,74 +66,195 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +/** + * This class represents a collection of HTTP protocol parameters applicable to + * {@link org.apache.commons.httpclient.HttpClient instances of HttpClient}. + * Protocol parameters may be linked together to form a hierarchy. If a particular + * parameter value has not been explicitly defined in the collection itself, its + * value will be drawn from the parent collection of parameters. + * + * @author Oleg Kalnichevski + * + * @version $Revision$ + */ public class HttpClientParams extends HttpMethodParams { /** Log object for this class. */ private static final Log LOG = LogFactory.getLog(HttpParams.class); + /** + * Sets the socket timeout (SO_TIMEOUT) in milliseconds which is the + * timeout for waiting for data. A timeout value of zero is interpreted as an + * infinite timeout. + * This parameter expects a value of type {@link Integer}. + */ public static final String SO_TIMEOUT = "http.socket.timeout"; + + /** + * Sets the timeout until a connection is etablished. A value of zero + * means the timeout is not used. The default value is zero. + * This parameter expects a value of type {@link Integer}. + */ public static final String CONNECTION_TIMEOUT = "http.connection.timeout"; + + /** + * Sets the timeout in milliseconds used when retrieving an + * {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the + * {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}. + * This parameter expects a value of type {@link Long}. + */ public static final String CONNECTION_MANAGER_TIMEOUT = "http.connection-manager.timeout"; + + /** + * Defines the default + * {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} + * class. + * This parameter expects a value of type {@link Class}. + */ public static final String CONNECTION_MANAGER_CLASS = "http.connection-manager.class"; + + /** + * Defines whether authentication should be attempted preemptively. + * This parameter expects a value of type {@link Boolean}. + */ public static final String PREEMPTIVE_AUTHENTICATION = "http.authentication.preemptive"; + + /** + * Defines whether relative redirects should be rejected. + * This parameter expects a value of type {@link Boolean}. + */ public static final String REJECT_RELATIVE_REDIRECT = "http.protocol.reject-relative-redirect"; /** + * Creates a new collection of parameters with the collection returned + * by {@link #getDefaultParams()} as a parent. The collection will defer + * to its parent for a default value if a particular parameter is not + * explicitly set in the collection itself. * + * @see #getDefaultParams() */ public HttpClientParams() { super(); } /** - * @param defaults + * Creates a new collection of parameters with the given parent. + * The collection will defer to its parent for a default value + * if a particular parameter is not explicitly set in the collection + * itself. + * + * @param defaults the parent collection to defer to, if a parameter + * is not explictly set in the collection itself. + * + * @see #getDefaultParams() */ public HttpClientParams(HttpParams defaults) { super(defaults); } + /** + * Returns the socket timeout (SO_TIMEOUT) in milliseconds which is the + * timeout for waiting for data. A timeout value of zero is interpreted as an + * infinite timeout. + * + * @return timeout in milliseconds + */ public int getSoTimeout() { return getIntParameter(SO_TIMEOUT, 0); } - + /** + * Sets the socket timeout (SO_TIMEOUT) in milliseconds which is the + * timeout for waiting for data. A timeout value of zero is interpreted as an + * infinite timeout. + * + * @param timeout Timeout in milliseconds + */ public void setSoTimeout(int timeout) { setIntParameter(SO_TIMEOUT, timeout); } - + /** + * Returns the timeout until a connection is etablished. A value of zero + * means the timeout is not used. The default value is zero. + * + * @return timeout in milliseconds. + */ public int getConnectionTimeout() { return getIntParameter(CONNECTION_TIMEOUT, 0); } - + /** + * Sets the timeout until a connection is etablished. A value of zero + * means the timeout is not used. The default value is zero. + * + * @param timeout Timeout in milliseconds. + */ public void setConnectionTimeout(int timeout) { setIntParameter(CONNECTION_TIMEOUT, timeout); } - + /** + * Returns the timeout in milliseconds used when retrieving an + * {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the + * {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}. + * + * @return timeout in milliseconds. + */ public long getConnectionManagerTimeout() { return getLongParameter(CONNECTION_MANAGER_TIMEOUT, 0); } - + /** + * Sets the timeout in milliseconds used when retrieving an + * {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the + * {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}. + * + * @param timeout the timeout in milliseconds + */ public void setConnectionManagerTimeout(long timeout) { setLongParameter(CONNECTION_MANAGER_TIMEOUT, timeout); } + /** + * Returns the default + * {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} + * class. + * @return {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} + * factory class. + */ public Class getConnectionManagerClass() { return (Class) getParameter(CONNECTION_MANAGER_CLASS); } + /** + * Sets {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} + * class to be used der default. + * @param clazz + * {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} + * factory class. + */ public void setConnectionManagerClass(Class clazz) { setParameter(CONNECTION_MANAGER_CLASS, clazz); } + /** + * Returns true if authentication should be attempted preemptively, + * false otherwise. + * + * @return true if authentication should be attempted preemptively, + * false otherwise. + */ public boolean isAuthenticationPreemptive() { return getBooleanParameter(PREEMPTIVE_AUTHENTICATION, false); } - + /** + * Sets whether authentication should be attempted preemptively. + * + * @param value true if authentication should be attempted preemptively, + * false otherwise. + */ public void setAuthenticationPreemptive(boolean value) { setBooleanParameter(PREEMPTIVE_AUTHENTICATION, value); } @@ -153,11 +274,4 @@ super.makeLenient(); setParameters(PROTOCOL_STRICTNESS_PARAMETERS, new Boolean(false)); } - - - public void makeDefault() { - super.makeDefault(); - setParameters(PROTOCOL_STRICTNESS_PARAMETERS, null); - } - } Index: java/org/apache/commons/httpclient/params/HttpMethodParams.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/HttpMethodParams.java,v retrieving revision 1.1 diff -u -r1.1 HttpMethodParams.java --- java/org/apache/commons/httpclient/params/HttpMethodParams.java 11 Sep 2003 20:08:33 -0000 1.1 +++ java/org/apache/commons/httpclient/params/HttpMethodParams.java 22 Sep 2003 10:10:02 -0000 @@ -67,33 +67,99 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +/** + * This class represents a collection of HTTP protocol parameters applicable to + * {@link org.apache.commons.httpclient.HttpMethod HTTP methods}. Protocol + * parameters may be linked together to form a hierarchy. If a particular + * parameter value has not been explicitly defined in the collection itself, + * its value will be drawn from the parent collection of parameters. + * + * @author Oleg Kalnichevski + * + * @version $Revision$ + */ public class HttpMethodParams extends DefaultHttpParams { /** Log object for this class. */ private static final Log LOG = LogFactory.getLog(HttpMethodParams.class); + /** + * Defines the content of the User-Agent header used by + * {@link org.apache.commons.httpclient.HttpMethod HTTP methods}. + * This parameter expects a value of type {@link String}. + */ public static final String USER_AGENT = "http.useragent"; + + /** + * Defines the {@link HttpVersion HTTP protocol version} used by + * {@link org.apache.commons.httpclient.HttpMethod HTTP methods} per + * default. + * This parameter expects a value of type {@link HttpVersion}. + */ public static final String PROTOCOL_VERSION = "http.protocol.version"; + /** + * Defines whether {@link org.apache.commons.httpclient.HttpMethod HTTP methods} should + * reject ambiguous {@link org.apache.commons.httpclient.StatusLine HTTP status line}. + * This parameter expects a value of type {@link Boolean}. + */ public static final String UNAMBIGUOUS_STATUS_LINE = "http.protocol.unambiguous-statusline"; + + /** + * Defines whether {@link org.apache.commons.httpclient.Cookie cookies} should be put on + * a single {@link org.apache.commons.httpclient.Header response header}. + * This parameter expects a value of type {@link Boolean}. + */ public static final String SINGLE_COOKIE_HEADER = "http.protocol.single-cookie-header"; + + /** + * Defines whether responses with an invalid Transfer-Encoding header should be + * rejected. + * This parameter expects a value of type {@link Boolean}. + */ public static final String STRICT_TRANSFER_ENCODING = "http.protocol.strict-transfer-encoding"; + + /** + * Defines whether the content body sent in response to + * {@link org.apache.commons.httpclient.methods.HeadMethod} should be rejected. + * This parameter expects a value of type {@link Boolean}. + */ public static final String REJECT_HEAD_BODY = "http.protocol.reject-head-body"; /** + * Creates a new collection of parameters with the collection returned + * by {@link #getDefaultParams()} as a parent. The collection will defer + * to its parent for a default value if a particular parameter is not + * explicitly set in the collection itself. * + * @see #getDefaultParams() */ public HttpMethodParams() { super(); } /** - * @param defaults + * Creates a new collection of parameters with the given parent. + * The collection will defer to its parent for a default value + * if a particular parameter is not explicitly set in the collection + * itself. + * + * @param defaults the parent collection to defer to, if a parameter + * is not explictly set in the collection itself. + * + * @see #getDefaultParams() */ public HttpMethodParams(HttpParams defaults) { super(defaults); } + /** + * Returns {@link HttpVersion HTTP protocol version} to be used by the + * {@link org.apache.commons.httpclient.HttpMethod HTTP methods} that + * this collection of parameters applies to. + * + * @return {@link HttpVersion HTTP protocol version} + */ public HttpVersion getVersion() { Object param = getParameter(PROTOCOL_VERSION); if (param == null) { @@ -102,7 +168,13 @@ return (HttpVersion)param; } - + /** + * Assigns the {@link HttpVersion HTTP protocol version} to be used by the + * {@link org.apache.commons.httpclient.HttpMethod HTTP methods} that + * this collection of parameters applies to. + * + * @param version the {@link HttpVersion HTTP protocol version} + */ public void setVersion(HttpVersion version) { setParameter(PROTOCOL_VERSION, version); } @@ -115,19 +187,25 @@ REJECT_HEAD_BODY }; - + /** + * Makes the {@link org.apache.commons.httpclient.HttpMethod HTTP methods} + * strictly follow the HTTP protocol specification (RFC 2616 and other relevant RFCs). + * It must be noted that popular HTTP agents have different degree of HTTP protocol + * compliance and some HTTP serves are programmed to expect the behaviour that does not + * strictly adhere to the HTTP specification. + */ public void makeStrict() { setParameters(PROTOCOL_STRICTNESS_PARAMETERS, new Boolean(true)); } - + /** + * Makes the {@link org.apache.commons.httpclient.HttpMethod HTTP methods} + * attempt to mimic the exact behaviour of commonly used HTTP agents, + * which many HTTP servers expect, even though such behaviour may violate + * the HTTP protocol specification (RFC 2616 and other relevant RFCs). + */ public void makeLenient() { setParameters(PROTOCOL_STRICTNESS_PARAMETERS, new Boolean(false)); - } - - - public void makeDefault() { - setParameters(PROTOCOL_STRICTNESS_PARAMETERS, null); } } Index: java/org/apache/commons/httpclient/params/HttpParams.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/HttpParams.java,v retrieving revision 1.1 diff -u -r1.1 HttpParams.java --- java/org/apache/commons/httpclient/params/HttpParams.java 11 Sep 2003 20:08:33 -0000 1.1 +++ java/org/apache/commons/httpclient/params/HttpParams.java 22 Sep 2003 10:10:02 -0000 @@ -65,9 +65,9 @@ /** * This interface represents a collection of HTTP protocol parameters. Protocol parameters - * may be linked together to form a hierarchy. A parameter may be off, on - * or not explicitly defined. If a parameter value has not been explicitly defined, - * its default value will be drawn from the upper level collection of parameters. + * may be linked together to form a hierarchy. If a particular parameter value has not been + * explicitly defined in the collection itself, its value will be drawn from the parent + * collection of parameters. * * @author Oleg Kalnichevski * @@ -77,32 +77,169 @@ public interface HttpParams { + /** + * Returns the parent collection that this collection will defer to + * for a default value if a particular parameter is not explicitly + * set in the collection itself + * + * @return the parent collection to defer to, if a particular parameter + * is not explictly set in the collection itself. + * + * @see #setDefaults(HttpParams) + */ public HttpParams getDefaults(); + /** + * Assigns the parent collection that this collection will defer to + * for a default value if a particular parameter is not explicitly + * set in the collection itself + * + * @param params the parent collection to defer to, if a particular + * parameter is not explictly set in the collection itself. + * + * @see #getDefaults() + */ public void setDefaults(final HttpParams params); + /** + * Returns a parameter value with the given name. If the parameter is + * not explicitly defined in this collection, its value will be drawn + * from a higer level collection at which this parameter is defined. + * If the parameter is not explicitly set anywhere up the hierarchy, + * null value is returned. + * + * @param name the parent name. + * + * @return an object that represents the value of the parameter. + * + * @see #setParameter(String, Object) + */ public Object getParameter(final String name); + /** + * Assigns the value to the parameter with the given name + * + * @param name parameter name + * @param value parameter value + */ public void setParameter(final String name, final Object value); + /** + * Returns a {@link Long} parameter value with the given name. + * If the parameter is not explicitly defined in this collection, its + * value will be drawn from a higer level collection at which this parameter + * is defined. If the parameter is not explicitly set anywhere up the hierarchy, + * the default value is returned. + * + * @param name the parent name. + * @param defaultValue the default value. + * + * @return a {@link Long} that represents the value of the parameter. + * + * @see #setLongParameter(String, long) + */ public long getLongParameter(final String name, long defaultValue); + /** + * Assigns a {@link Long} to the parameter with the given name + * + * @param name parameter name + * @param value parameter value + */ public void setLongParameter(final String name, long value); + /** + * Returns an {@link Integer} parameter value with the given name. + * If the parameter is not explicitly defined in this collection, its + * value will be drawn from a higer level collection at which this parameter + * is defined. If the parameter is not explicitly set anywhere up the hierarchy, + * the default value is returned. + * + * @param name the parent name. + * @param defaultValue the default value. + * + * @return a {@link Integer} that represents the value of the parameter. + * + * @see #setIntParameter(String, int) + */ public int getIntParameter(final String name, int defaultValue); + /** + * Assigns an {@link Integer} to the parameter with the given name + * + * @param name parameter name + * @param value parameter value + */ public void setIntParameter(final String name, int value); + /** + * Returns a {@link Double} parameter value with the given name. + * If the parameter is not explicitly defined in this collection, its + * value will be drawn from a higer level collection at which this parameter + * is defined. If the parameter is not explicitly set anywhere up the hierarchy, + * the default value is returned. + * + * @param name the parent name. + * @param defaultValue the default value. + * + * @return a {@link Double} that represents the value of the parameter. + * + * @see #setDoubleParameter(String, double) + */ public double getDoubleParameter(final String name, double defaultValue); + /** + * Assigns a {@link Double} to the parameter with the given name + * + * @param name parameter name + * @param value parameter value + */ public void setDoubleParameter(final String name, double value); + /** + * Returns a {@link Boolean} parameter value with the given name. + * If the parameter is not explicitly defined in this collection, its + * value will be drawn from a higer level collection at which this parameter + * is defined. If the parameter is not explicitly set anywhere up the hierarchy, + * the default value is returned. + * + * @param name the parent name. + * @param defaultValue the default value. + * + * @return a {@link Boolean} that represents the value of the parameter. + * + * @see #setBooleanParameter(String, boolean) + */ public boolean getBooleanParameter(final String name, boolean defaultValue); + /** + * Assigns a {@link Boolean} to the parameter with the given name + * + * @param name parameter name + * @param value parameter value + */ public void setBooleanParameter(final String name, boolean value); + /** + * Returns true if the parameter is set and is true, false + * otherwise. + * + * @param name parameter name + * + * @return true if the parameter is set and is true, false + * otherwise. + */ public boolean isParameterTrue(final String name); + /** + * Returns true if the parameter is either not set or is false, + * false otherwise. + * + * @param name parameter name + * + * @return true if the parameter is either not set or is false, + * false otherwise. + */ public boolean isParameterFalse(final String name); }