|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ferris.net.UrlStringBuilder
public class UrlStringBuilder
The purpose of this class is to take a URL object convert it to a String, then allow the addition of request query parameters (fname=michael,lname=remijan) and then convert the String back to a URL object. This class will use URLEncoder to make sure special characters are escaped properly.
Constructor Summary | |
---|---|
UrlStringBuilder()
Default constructor |
|
UrlStringBuilder(URL url)
Get url.toString() put it in a
StringBuilder then append the "?"
character. |
Method Summary | |
---|---|
void |
append(boolean value)
Regular StringBuilder append |
void |
append(byte value)
Regular StringBuilder append |
void |
append(char value)
Regular StringBuilder append |
void |
append(double value)
Regular StringBuilder append |
void |
append(float value)
Regular StringBuilder append |
void |
append(int value)
Regular StringBuilder append |
void |
append(long value)
Regular StringBuilder append |
void |
append(Object value)
Regular StringBuilder append |
void |
append(short value)
Regular StringBuilder append |
void |
append(String value)
Regular StringBuilder append |
void |
append(String name,
boolean value)
Append name/value pair when value is a boolean. |
void |
append(String name,
byte value)
Append name/value pair when value is a byte. |
void |
append(String name,
char value)
Append name/value pair when value is a char. |
void |
append(String name,
double value)
Append name/value pair when value is a double. |
void |
append(String name,
float value)
Append name/value pair when value is a float. |
void |
append(String name,
int value)
Append name/value pair when value is an int. |
void |
append(String name,
long value)
Append name/value pair when value is a long. |
void |
append(String name,
Object value)
Append name/value pair when value is a Object using Object.toString() and then using URLEncoder to encode using encoding UTF-8 to make sure special characters are handled correctly. |
void |
append(String name,
short value)
Append name/value pair when value is an short. |
void |
append(String name,
String value)
Append name/value pair when value is a String, use URLEncoder to encode using encoding UTF-8 to make sure special characters are handled correctly. |
String |
toString()
Return what's been appended to this builder |
URL |
toUrl()
Get a new URL |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UrlStringBuilder()
public UrlStringBuilder(URL url)
url.toString()
put it in a
StringBuilder
then append the "?"
character. After this call the append(..)
methods to add request query parameters after the "?".
If you're URL already has request query parameters in it
that's ok, this class will just append more on.
When done, call the toUrl()
method
to get a new URL object.
url
-
NetException
Method Detail |
---|
public URL toUrl()
public void append(String name, double value)
public void append(String name, int value)
public void append(String name, short value)
public void append(String name, boolean value)
public void append(String name, char value)
public void append(String name, byte value)
public void append(String name, long value)
public void append(String name, float value)
public void append(String name, String value)
public void append(String name, Object value)
public void append(boolean value)
public void append(char value)
public void append(byte value)
public void append(short value)
public void append(int value)
public void append(long value)
public void append(float value)
public void append(double value)
public void append(String value)
public void append(Object value)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |