|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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()
HttpParams
getDefaults in interface HttpParamsHttpParams.setDefaults(HttpParams)public void setDefaults(HttpParams params)
HttpParams
setDefaults in interface HttpParamsparams - 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)
HttpParams
getParameter in interface HttpParamsname - the parent name.
HttpParams.setParameter(String, Object)
public void setParameter(String name,
Object value)
HttpParams
setParameter in interface HttpParamsname - parameter namevalue - parameter value
public void setParameters(String[] names,
Object value)
names - array of parameter namevalue - parameter value
public long getLongParameter(String name,
long defaultValue)
HttpParamsLong 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 HttpParamsname - 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)
HttpParamsLong to the parameter with the given name
setLongParameter in interface HttpParamsname - parameter namevalue - parameter value
public int getIntParameter(String name,
int defaultValue)
HttpParamsInteger 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 HttpParamsname - 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)
HttpParamsInteger to the parameter with the given name
setIntParameter in interface HttpParamsname - parameter namevalue - parameter value
public double getDoubleParameter(String name,
double defaultValue)
HttpParamsDouble 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 HttpParamsname - 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)
HttpParamsDouble to the parameter with the given name
setDoubleParameter in interface HttpParamsname - parameter namevalue - parameter value
public boolean getBooleanParameter(String name,
boolean defaultValue)
HttpParamsBoolean 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 HttpParamsname - 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)
HttpParamsBoolean to the parameter with the given name
setBooleanParameter in interface HttpParamsname - parameter namevalue - parameter valuepublic boolean isParameterSet(String name)
HttpParams
isParameterSet in interface HttpParamsname - parameter name
public boolean isParameterSetLocally(String name)
HttpParams
isParameterSetLocally in interface HttpParamsname - parameter name
public boolean isParameterTrue(String name)
HttpParams
isParameterTrue in interface HttpParamsname - parameter name
public boolean isParameterFalse(String name)
HttpParams
isParameterFalse in interface HttpParamsname - parameter name
public void clear()
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionSerializable,
Object.clone()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||