Methods Summary |
---|
protected abstract java.lang.String | encodeBody()Encodes the contents as a string.
|
protected java.lang.String | encodeWithSep()Encodes the parameters as a string.
if (parameters == null) {
return "";
} else {
return parameters.encodeWithSep();
}
|
public NameValue | getNameValue(java.lang.String parameterName)This is for the benifit of the TCK.
return parameters.getNameValue(parameterName);
|
public java.lang.String | getParameter(java.lang.String name)Returns the value of the named parameter, or null if it is not set. A
zero-length String indicates flag parameter.
return this.parameters.getParameter(name);
|
protected boolean | getParameterAsBoolean(java.lang.String parameterName)Gets the parameter value as a boolean.
Object val = getParameterValue(parameterName);
if (val == null) {
return false;
} else if (val instanceof Boolean) {
return ((Boolean) val).booleanValue();
} else if (val instanceof String) {
return equalsIgnoreCase((String)val, "true");
} else return false;
|
protected int | getParameterAsHexInt(java.lang.String parameterName)Gets the parameter as an integer when it is entered as a hex.
if (this.getParameterValue(parameterName) != null) {
try {
if (this.getParameterValue(parameterName)
instanceof String) {
return Integer.parseInt
(this.getParameter(parameterName), 16);
} else {
return
((Integer)getParameterValue(parameterName)).intValue();
}
} catch (NumberFormatException ex) {
return -1;
}
} else return -1;
|
protected int | getParameterAsInt(java.lang.String parameterName)Gets the parameter as an integer value.
if (this.getParameterValue(parameterName) != null) {
try {
if (this.getParameterValue(parameterName)
instanceof String) {
return Integer.parseInt
(this.getParameter(parameterName));
} else {
return
((Integer)getParameterValue(parameterName)).intValue();
}
} catch (NumberFormatException ex) {
return -1;
}
} else return -1;
|
protected long | getParameterAsLong(java.lang.String parameterName)Gets the parameter as a long value.
if (this.getParameterValue(parameterName) != null) {
try {
if (this.getParameterValue(parameterName)
instanceof String) {
return Long.parseLong
(this.getParameter(parameterName));
} else {
return
((Long)getParameterValue(parameterName)).longValue();
}
} catch (NumberFormatException ex) {
return -1;
}
} else return -1;
|
protected URI | getParameterAsURI(java.lang.String parameterName)Gets the parameter value as a URI.
Object val = getParameterValue(parameterName);
if (val instanceof URI)
return (URI) val;
else {
try {
return new URI((String)val);
} catch (ParseException ex) {
// catch (URISyntaxException ex) {
return null;
}
}
|
public java.util.Vector | getParameterNames()Returns an Vector over the names (Strings) of all parameters present
in this ParametersHeader.
return parameters.getNames();
|
public java.lang.Object | getParameterValue(java.lang.String name)Returns the parameter as an object (dont convert to string).
return this.parameters.getValue(name);
|
public NameValueList | getParameters()get the parameter list.
return parameters;
|
public boolean | hasParameter(java.lang.String parameterName)Returns true if has a parameter.
return this.parameters.hasNameValue(parameterName);
|
public boolean | hasParameters()Returns true if you have a parameter and false otherwise.
return parameters != null && ! parameters.isEmpty();
|
public void | removeParameter(java.lang.String name)Removes the specified parameter from Parameters of this ParametersHeader.
This method returns silently if the parameter is not part of the
ParametersHeader.
this.parameters.delete(name);
|
public void | removeParameters()Removes all parameters.
this.parameters = new NameValueList();
|
protected void | setParameter(java.lang.String name, int value)Sets the value of the specified parameter. If the parameter already had
a value it will be overwritten.
Integer val = new Integer(value);
NameValue nv = parameters.getNameValue(name);
if (nv != null) {
nv.setValue(val);
} else {
nv = new NameValue(name, val);
this.parameters.set(nv);
}
|
protected void | setParameter(java.lang.String name, boolean value)Sets the value of the specified parameter. If the parameter already had
a value it will be overwritten.
Boolean val = new Boolean(value);
NameValue nv = parameters.getNameValue(name);
if (nv != null) {
nv.setValue(val);
} else {
nv = new NameValue(name, val);
this.parameters.set(nv);
}
|
protected void | setParameter(java.lang.String name, java.lang.Object value)Sets the value of the specified parameter. If the parameter already had
a value it will be overwritten. A zero-length String indicates flag
parameter.
NameValue nv = parameters.getNameValue(name);
if (nv != null) {
nv.setValue(value);
} else {
nv = new NameValue(name, value);
this.parameters.set(nv);
}
|
public void | setParameter(NameValue nameValue)Sets the parameter given a name and value.
this.parameters.set(nameValue);
|
public void | setParameter(java.lang.String name, java.lang.String value)Sets the value of the specified parameter. If the parameter already had
a value it will be overwritten. A zero-length String indicates flag
parameter.
NameValue nv = parameters.getNameValue(name);
if (nv != null) {
nv.setValue(value);
} else {
nv = new NameValue(name, value);
}
this.parameters.set(nv);
|
public void | setParameters(NameValueList parameters)Sets the parameter list.
this.parameters = parameters;
|
public void | setQuotedParameter(java.lang.String name, java.lang.String value)Sets the value of the specified parameter. If the parameter already had
a value it will be overwritten. A zero-length String indicates flag
parameter.
NameValue nv = parameters.getNameValue(name);
if (nv != null) {
nv.setValue(value);
nv.setQuotedValue();
} else {
nv = new NameValue(name, value);
nv.setQuotedValue();
this.parameters.set(nv);
}
|