org.apache.commons.httpclient.params

Class DefaultHttpParams

public class DefaultHttpParams extends Object implements HttpParams, Serializable, Cloneable

This class represents a collection of HTTP protocol parameters. 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.

Since: 3.0

Version: $Revision: 510589 $

Author: Oleg Kalnichevski

Constructor Summary
DefaultHttpParams(HttpParams defaults)
Creates a new collection of parameters with the given parent.
DefaultHttpParams()
Creates a new collection of parameters with the collection returned by getDefaultParams as a parent.
Method Summary
voidclear()
Removes all parameters from this collection.
Objectclone()
Clones this collection of parameters.
booleangetBooleanParameter(String name, boolean defaultValue)
static HttpParamsgetDefaultParams()
Gets the default HttpParams to be used.
HttpParamsgetDefaults()
doublegetDoubleParameter(String name, double defaultValue)
intgetIntParameter(String name, int defaultValue)
longgetLongParameter(String name, long defaultValue)
ObjectgetParameter(String name)
booleanisParameterFalse(String name)
booleanisParameterSet(String name)
booleanisParameterSetLocally(String name)
booleanisParameterTrue(String name)
voidsetBooleanParameter(String name, boolean value)
voidsetDefaults(HttpParams params)
voidsetDoubleParameter(String name, double value)
static voidsetHttpParamsFactory(HttpParamsFactory httpParamsFactory)
Sets the factory that will provide the default HttpParams.
voidsetIntParameter(String name, int value)
voidsetLongParameter(String name, long value)
voidsetParameter(String name, Object value)
voidsetParameters(String[] names, Object value)
Assigns the value to all the parameter with the given names

Constructor Detail

DefaultHttpParams

public DefaultHttpParams(HttpParams 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.

Parameters: defaults the parent collection to defer to, if a parameter is not explictly set in the collection itself.

DefaultHttpParams

public DefaultHttpParams()
Creates a new collection of parameters with the collection returned by 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 Also: getDefaultParams

Method Detail

clear

public void clear()
Removes all parameters from this collection.

clone

public Object clone()
Clones this collection of parameters. Please note that paramter values themselves are not cloned.

See Also: java.io.Serializable java.lang.Object#clone()

getBooleanParameter

public boolean getBooleanParameter(String name, boolean defaultValue)

getDefaultParams

public static HttpParams getDefaultParams()
Gets the default HttpParams to be used.

Returns: the value returned from HttpParamsFactory#getDefaultParams()

See Also: getDefaultParams

getDefaults

public HttpParams getDefaults()

getDoubleParameter

public double getDoubleParameter(String name, double defaultValue)

getIntParameter

public int getIntParameter(String name, int defaultValue)

getLongParameter

public long getLongParameter(String name, long defaultValue)

getParameter

public Object getParameter(String name)

isParameterFalse

public boolean isParameterFalse(String name)

isParameterSet

public boolean isParameterSet(String name)

isParameterSetLocally

public boolean isParameterSetLocally(String name)

isParameterTrue

public boolean isParameterTrue(String name)

setBooleanParameter

public void setBooleanParameter(String name, boolean value)

setDefaults

public void setDefaults(HttpParams params)

setDoubleParameter

public void setDoubleParameter(String name, double value)

setHttpParamsFactory

public static void setHttpParamsFactory(HttpParamsFactory httpParamsFactory)
Sets the factory that will provide the default HttpParams.

Parameters: httpParamsFactory an instance of HttpParamsFactory

See Also: getDefaultParams

setIntParameter

public void setIntParameter(String name, int value)

setLongParameter

public void setLongParameter(String name, long value)

setParameter

public void setParameter(String name, Object value)

setParameters

public void setParameters(String[] names, Object value)
Assigns the value to all the parameter with the given names

Parameters: names array of parameter name value parameter value

Copyright (c) 1999-2005 - Apache Software Foundation