Package org.glassfish.grizzly.http.util
Class Parameters
- java.lang.Object
-
- org.glassfish.grizzly.http.util.Parameters
-
public final class Parameters extends Object
- Author:
- Costin Manolache
-
-
Field Summary
Fields Modifier and Type Field Description static CharsetDEFAULT_CHARSETstatic StringDEFAULT_ENCODINGstatic intINITIAL_SIZE
-
Constructor Summary
Constructors Constructor Description Parameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParameter(String key, String value)voidaddParameterValues(String key, String[] newValues)ParametersgetCurrentSet()CharsetgetEncoding()StringgetParameter(String name)Set<String>getParameterNames()String[]getParameterValues(String name)CharsetgetQueryStringEncoding()voidhandleQueryParameters()Process the query string into parametersStringparamsAsString()Debug purposevoidpop()Discard the last child.voidprocessParameters(char[] chars, int start, int len)voidprocessParameters(String str)voidprocessParameters(org.glassfish.grizzly.Buffer buffer, int start, int len)voidprocessParameters(org.glassfish.grizzly.Buffer buffer, int start, int len, Charset enc)voidprocessParameters(DataChunk data)voidprocessParameters(DataChunk data, Charset encoding)voidpush()Create ( or reuse ) a child that will be used during a sub-request.voidrecycle()voidsetEncoding(Charset encoding)voidsetHeaders(MimeHeaders headers)voidsetLimit(int limit)voidsetQuery(DataChunk queryBC)voidsetQueryStringEncoding(Charset queryStringEncoding)
-
-
-
Field Detail
-
INITIAL_SIZE
public static final int INITIAL_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_ENCODING
public static final String DEFAULT_ENCODING
-
DEFAULT_CHARSET
public static final Charset DEFAULT_CHARSET
-
-
Method Detail
-
setQuery
public void setQuery(DataChunk queryBC)
-
setHeaders
public void setHeaders(MimeHeaders headers)
-
setLimit
public void setLimit(int limit)
-
setEncoding
public void setEncoding(Charset encoding)
-
getEncoding
public Charset getEncoding()
-
setQueryStringEncoding
public void setQueryStringEncoding(Charset queryStringEncoding)
-
getQueryStringEncoding
public Charset getQueryStringEncoding()
-
recycle
public void recycle()
-
getCurrentSet
public Parameters getCurrentSet()
-
push
public void push()
Create ( or reuse ) a child that will be used during a sub-request. All future changes ( setting query string, adding parameters ) will affect the child ( the parent request is never changed ). Both setters and getters will return the data from the deepest child, merged with data from parents.
-
pop
public void pop()
Discard the last child. This happens when we return from a sub-request and the parameters are locally modified.
-
handleQueryParameters
public void handleQueryParameters()
Process the query string into parameters
-
addParameter
public void addParameter(String key, String value) throws IllegalStateException
- Throws:
IllegalStateException
-
processParameters
public void processParameters(org.glassfish.grizzly.Buffer buffer, int start, int len)
-
processParameters
public void processParameters(org.glassfish.grizzly.Buffer buffer, int start, int len, Charset enc)
-
processParameters
public void processParameters(char[] chars, int start, int len)
-
processParameters
public void processParameters(DataChunk data)
-
paramsAsString
public String paramsAsString()
Debug purpose
-
processParameters
public void processParameters(String str)
-
-