org.eclipse.jetty.util
类 UrlEncoded

java.lang.Object
  继承者 org.eclipse.jetty.util.MultiMap
      继承者 org.eclipse.jetty.util.UrlEncoded
所有已实现的接口:
Serializable, Cloneable, ConcurrentMap, Map

public class UrlEncoded
extends MultiMap
implements Cloneable

Handles coding of MIME "x-www-form-urlencoded".

This class handles the encoding and decoding for either the query string of a URL or the _content of a POST HTTP request.

Notes

The UTF-8 charset is assumed, unless otherwise defined by either passing a parameter or setting the "org.eclipse.jetty.util.UrlEncoding.charset" System property.

The hashtable either contains String single values, vectors of String or arrays of Strings.

This class is only partially synchronised. In particular, simple get operations are not protected from concurrent updates.

另请参见:
URLEncoder, 序列化表格

嵌套类摘要
 
从接口 java.util.Map 继承的嵌套类/接口
Map.Entry<K,V>
 
字段摘要
static String ENCODING
           
 
构造方法摘要
UrlEncoded()
           
UrlEncoded(String s)
           
UrlEncoded(String s, String charset)
           
UrlEncoded(UrlEncoded url)
           
 
方法摘要
 Object clone()
           
 void decode(String query)
           
 void decode(String query, String charset)
           
static void decode88591To(InputStream in, MultiMap map, int maxLength, int maxKeys)
          Decoded parameters to Map.
static String decodeString(String encoded, int offset, int length, String charset)
          Decode String with % encoding.
static void decodeTo(InputStream in, MultiMap map, String charset, int maxLength, int maxKeys)
          Decoded parameters to Map.
static void decodeTo(String content, MultiMap map, String charset)
          Decoded parameters to Map.
static void decodeTo(String content, MultiMap map, String charset, int maxKeys)
          Decoded parameters to Map.
static void decodeUtf16To(InputStream in, MultiMap map, int maxLength, int maxKeys)
           
static void decodeUtf8To(byte[] raw, int offset, int length, MultiMap map)
          Decoded parameters to Map.
static void decodeUtf8To(byte[] raw, int offset, int length, MultiMap map, Utf8StringBuilder buffer)
          Decoded parameters to Map.
static void decodeUtf8To(InputStream in, MultiMap map, int maxLength, int maxKeys)
          Decoded parameters to Map.
 String encode()
          Encode Hashtable with % encoding.
static String encode(MultiMap map, String charset, boolean equalsForNullValue)
          Encode Hashtable with % encoding.
 String encode(String charset)
          Encode Hashtable with % encoding.
 String encode(String charset, boolean equalsForNullValue)
          Encode Hashtable with % encoding.
static String encodeString(String string)
          Perform URL encoding.
static String encodeString(String string, String charset)
          Perform URL encoding.
 
从类 org.eclipse.jetty.util.MultiMap 继承的方法
add, addValues, addValues, clear, containsKey, containsValue, entrySet, equals, get, getString, getValue, getValues, hashCode, isEmpty, keySet, put, putAll, putIfAbsent, putValues, putValues, remove, remove, removeValue, replace, replace, size, toString, toStringArrayMap, values
 
从类 java.lang.Object 继承的方法
finalize, getClass, notify, notifyAll, wait, wait, wait
 

字段详细信息

ENCODING

public static final String ENCODING
构造方法详细信息

UrlEncoded

public UrlEncoded(UrlEncoded url)

UrlEncoded

public UrlEncoded()

UrlEncoded

public UrlEncoded(String s)

UrlEncoded

public UrlEncoded(String s,
                  String charset)
方法详细信息

decode

public void decode(String query)

decode

public void decode(String query,
                   String charset)

encode

public String encode()
Encode Hashtable with % encoding.


encode

public String encode(String charset)
Encode Hashtable with % encoding.


encode

public String encode(String charset,
                     boolean equalsForNullValue)
Encode Hashtable with % encoding.

参数:
equalsForNullValue - if True, then an '=' is always used, even for parameters without a value. e.g. "blah?a=&b=&c=".

encode

public static String encode(MultiMap map,
                            String charset,
                            boolean equalsForNullValue)
Encode Hashtable with % encoding.

参数:
equalsForNullValue - if True, then an '=' is always used, even for parameters without a value. e.g. "blah?a=&b=&c=".

decodeTo

public static void decodeTo(String content,
                            MultiMap map,
                            String charset)
Decoded parameters to Map.

参数:
content - the string containing the encoded parameters

decodeTo

public static void decodeTo(String content,
                            MultiMap map,
                            String charset,
                            int maxKeys)
Decoded parameters to Map.

参数:
content - the string containing the encoded parameters

decodeUtf8To

public static void decodeUtf8To(byte[] raw,
                                int offset,
                                int length,
                                MultiMap map)
Decoded parameters to Map.

参数:
raw - the byte[] containing the encoded parameters
offset - the offset within raw to decode from
length - the length of the section to decode
map - the MultiMap to populate

decodeUtf8To

public static void decodeUtf8To(byte[] raw,
                                int offset,
                                int length,
                                MultiMap map,
                                Utf8StringBuilder buffer)
Decoded parameters to Map.

参数:
raw - the byte[] containing the encoded parameters
offset - the offset within raw to decode from
length - the length of the section to decode
map - the MultiMap to populate
buffer - the buffer to decode into

decode88591To

public static void decode88591To(InputStream in,
                                 MultiMap map,
                                 int maxLength,
                                 int maxKeys)
                          throws IOException
Decoded parameters to Map.

参数:
in - InputSteam to read
map - MultiMap to add parameters to
maxLength - maximum number of keys to read or -1 for no limit
抛出:
IOException

decodeUtf8To

public static void decodeUtf8To(InputStream in,
                                MultiMap map,
                                int maxLength,
                                int maxKeys)
                         throws IOException
Decoded parameters to Map.

参数:
in - InputSteam to read
map - MultiMap to add parameters to
maxLength - maximum number of keys to read or -1 for no limit
抛出:
IOException

decodeUtf16To

public static void decodeUtf16To(InputStream in,
                                 MultiMap map,
                                 int maxLength,
                                 int maxKeys)
                          throws IOException
抛出:
IOException

decodeTo

public static void decodeTo(InputStream in,
                            MultiMap map,
                            String charset,
                            int maxLength,
                            int maxKeys)
                     throws IOException
Decoded parameters to Map.

参数:
in - the stream containing the encoded parameters
抛出:
IOException

decodeString

public static String decodeString(String encoded,
                                  int offset,
                                  int length,
                                  String charset)
Decode String with % encoding. This method makes the assumption that the majority of calls will need no decoding.


encodeString

public static String encodeString(String string)
Perform URL encoding.

参数:
string -
返回:
encoded string.

encodeString

public static String encodeString(String string,
                                  String charset)
Perform URL encoding.

参数:
string -
返回:
encoded string.

clone

public Object clone()
覆盖:
Object 中的 clone


Copyright © 2013. All Rights Reserved.