|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.httpclient.params.DefaultHttpParams
public class DefaultHttpParams
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.
Constructor Summary | |
---|---|
DefaultHttpParams()
Creates a new collection of parameters with the collection returned by getDefaultParams() as a parent. |
|
DefaultHttpParams(HttpParams defaults)
Creates a new collection of parameters with the given parent. |
Method Summary | |
---|---|
void |
clear()
Removes all parameters from this collection. |
Object |
clone()
Clones this collection of parameters. |
boolean |
getBooleanParameter(String name,
boolean defaultValue)
Returns a Boolean parameter value with the given name. |
static HttpParams |
getDefaultParams()
Gets the default HttpParams to be used. |
HttpParams |
getDefaults()
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 |
double |
getDoubleParameter(String name,
double defaultValue)
Returns a Double parameter value with the given name. |
int |
getIntParameter(String name,
int defaultValue)
Returns an Integer parameter value with the given name. |
long |
getLongParameter(String name,
long defaultValue)
Returns a Long parameter value with the given name. |
Object |
getParameter(String name)
Returns a parameter value with the given name. |
boolean |
isParameterFalse(String name)
Returns true if the parameter is either not set or is false, false otherwise. |
boolean |
isParameterSet(String name)
Returns true if the parameter is set at any level, false otherwise. |
boolean |
isParameterSetLocally(String name)
Returns true if the parameter is set locally, false otherwise. |
boolean |
isParameterTrue(String name)
Returns true if the parameter is set and is true, false otherwise. |
void |
setBooleanParameter(String name,
boolean value)
Assigns a Boolean to the parameter with the given name |
void |
setDefaults(HttpParams params)
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 |
void |
setDoubleParameter(String name,
double value)
Assigns a Double to the parameter with the given name |
static void |
setHttpParamsFactory(HttpParamsFactory httpParamsFactory)
Sets the factory that will provide the default HttpParams. |
void |
setIntParameter(String name,
int value)
Assigns an Integer to the parameter with the given name |
void |
setLongParameter(String name,
long value)
Assigns a Long to the parameter with the given name |
void |
setParameter(String name,
Object value)
Assigns the value to the parameter with the given name |
void |
setParameters(String[] names,
Object value)
Assigns the value to all the parameter with the given names |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultHttpParams(HttpParams defaults)
defaults
- the parent collection to defer to, if a parameter
is not explictly set in the collection itself.public DefaultHttpParams()
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.
getDefaultParams()
Method Detail |
---|
public static HttpParams getDefaultParams()
HttpParamsFactory#getDefaultParams()
HttpParamsFactory.getDefaultParams()
public static void setHttpParamsFactory(HttpParamsFactory httpParamsFactory)
httpParamsFactory
- an instance of HttpParamsFactorygetDefaultParams()
public HttpParams getDefaults()
getDefaults
in interface HttpParams
HttpParams.setDefaults(HttpParams)
public void setDefaults(HttpParams params)
setDefaults
in interface HttpParams
params
- the parent collection to defer to, if a particular
parameter is not explictly set in the collection itself.HttpParams.getDefaults()
public Object getParameter(String name)
getParameter
in interface HttpParams
name
- the parent name.
HttpParams.setParameter(String, Object)
public void setParameter(String name, Object value)
setParameter
in interface HttpParams
name
- parameter namevalue
- parameter valuepublic void setParameters(String[] names, Object value)
names
- array of parameter namevalue
- parameter valuepublic long getLongParameter(String name, long defaultValue)
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.
getLongParameter
in interface HttpParams
name
- the parent name.defaultValue
- the default value.
Long
that represents the value of the parameter.HttpParams.setLongParameter(String, long)
public void setLongParameter(String name, long value)
Long
to the parameter with the given name
setLongParameter
in interface HttpParams
name
- parameter namevalue
- parameter valuepublic int getIntParameter(String name, int defaultValue)
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.
getIntParameter
in interface HttpParams
name
- the parent name.defaultValue
- the default value.
Integer
that represents the value of the parameter.HttpParams.setIntParameter(String, int)
public void setIntParameter(String name, int value)
Integer
to the parameter with the given name
setIntParameter
in interface HttpParams
name
- parameter namevalue
- parameter valuepublic double getDoubleParameter(String name, double defaultValue)
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.
getDoubleParameter
in interface HttpParams
name
- the parent name.defaultValue
- the default value.
Double
that represents the value of the parameter.HttpParams.setDoubleParameter(String, double)
public void setDoubleParameter(String name, double value)
Double
to the parameter with the given name
setDoubleParameter
in interface HttpParams
name
- parameter namevalue
- parameter valuepublic boolean getBooleanParameter(String name, boolean defaultValue)
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.
getBooleanParameter
in interface HttpParams
name
- the parent name.defaultValue
- the default value.
Boolean
that represents the value of the parameter.HttpParams.setBooleanParameter(String, boolean)
public void setBooleanParameter(String name, boolean value)
Boolean
to the parameter with the given name
setBooleanParameter
in interface HttpParams
name
- parameter namevalue
- parameter valuepublic boolean isParameterSet(String name)
isParameterSet
in interface HttpParams
name
- parameter name
public boolean isParameterSetLocally(String name)
isParameterSetLocally
in interface HttpParams
name
- parameter name
public boolean isParameterTrue(String name)
isParameterTrue
in interface HttpParams
name
- parameter name
public boolean isParameterFalse(String name)
isParameterFalse
in interface HttpParams
name
- parameter name
public void clear()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Serializable
,
Object.clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |