Package org.simpleframework.http.core
Class QueryBuilder
java.lang.Object
org.simpleframework.http.core.QueryBuilder
The
QueryBuilder
object is used to create the query.
It is created using the request URI query and a form post body if
sent. The application/x-www-form-urlencoded conent type identifies
the body as contain form data. If there are duplicates then they
both are available from the query that is built.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQueryBuilder
(Request request, Entity entity) Constructor for theQueryBuilder
object. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
This method is used to acquire the query part from the HTTP request URI target and a form post if it exists.private String
This method attempts to acquire the content of the request body.private Query
This method is used to acquire the query part from the HTTP request URI target and a form post if it exists.private boolean
This is used to determine if the content type is a form POST of type application/x-www-form-urlencoded.private boolean
isFormPost
(ContentType type) This is used to determine if the content type is a form POST of type application/x-www-form-urlencoded.
-
Field Details
-
request
This is the request that is used to acquire the data. -
header
This is the header that is used to acquire the data.
-
-
Constructor Details
-
QueryBuilder
Constructor for theQueryBuilder
object. This will create an object that can be used to construct a single query from the multiple sources of data within the request entity.- Parameters:
request
- this is the request to build a query forentity
- this is the entity that contains the data
-
-
Method Details
-
build
This method is used to acquire the query part from the HTTP request URI target and a form post if it exists. Both the query and the form post are merge together in a single query.- Returns:
- the query associated with the HTTP target URI
-
getQuery
This method is used to acquire the query part from the HTTP request URI target and a form post if it exists. Both the query and the form post are merge together in a single query.- Parameters:
query
- this is the URI query string to be used- Returns:
- the query associated with the HTTP target URI
-
getContent
This method attempts to acquire the content of the request body. If there is anIOException
acquiring the content of the body then this will simply return a null value without reporting the exception.- Returns:
- the content of the body, or null on error
-
isFormPost
private boolean isFormPost()This is used to determine if the content type is a form POST of type application/x-www-form-urlencoded. Such a type is used when a HTML form is used to post data to the server.- Returns:
- this returns true if content type is a form post
-
isFormPost
This is used to determine if the content type is a form POST of type application/x-www-form-urlencoded. Such a type is used when a HTML form is used to post data to the server.- Parameters:
type
- the type to determine if its a form post- Returns:
- this returns true if content type is a form post
-