Class UrlDeserializer
java.lang.Object
cz.metacentrum.perun.rpc.deserializer.Deserializer
cz.metacentrum.perun.rpc.deserializer.UrlDeserializer
Deserializer for URL data format.
Reads parameters only from URL of request, which is typically GET. Doesn't read any parameters from request body (InputStream)!
- Author:
- Jan Klos invalid input: '<'ddd@mail.muni.cz>, Pavel Zlamal invalid input: '<'256627@mail.muni.cz>
-
Constructor Summary
ConstructorDescriptionUrlDeserializer
(jakarta.servlet.http.HttpServletRequest request) Create deserializer for URL data format. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if value with the specified name is supplied.jakarta.servlet.http.HttpServletRequest
Return HttpServletRequest related to concrete call this deserializer is used to process.readAll()
Returns string representation of the variables stored in the deserializer.int[]
readArrayOfInts
(String name) readBoolean
(String name) Reads value with the specified name asBoolean
.int
Reads value with the specified name asint
.<T> List
<T> Reads array with the specified name asList<valueType>
.readString
(String name) Reads value with the specified name asString
.Reads value with the specified name asUUID
.Methods inherited from class cz.metacentrum.perun.rpc.deserializer.Deserializer
read, read, readList, readListPerunBeans, readLocalDate, readPerunBean, stateChangingCheck
-
Constructor Details
-
UrlDeserializer
public UrlDeserializer(jakarta.servlet.http.HttpServletRequest request) Create deserializer for URL data format.- Parameters:
request
- HttpServletRequest this deserializer is about to process
-
-
Method Details
-
contains
Returnstrue
if value with the specified name is supplied. Check ignores array suffix "[]". It means, thattrue
is returned for both "name" and "name[]" parameters.- Specified by:
contains
in classDeserializer
- Parameters:
name
- name of the value to check- Returns:
true
if value with the specified name is supplied,false
otherwise
-
getServletRequest
public jakarta.servlet.http.HttpServletRequest getServletRequest()Description copied from class:Deserializer
Return HttpServletRequest related to concrete call this deserializer is used to process.Note that this "request" is not necessarily used as source to read parameters by other methods of deserializer. It IS typically for GET requests, but NOT for POST with JSON/JSONP data format.
- Overrides:
getServletRequest
in classDeserializer
- Returns:
- HttpServletRequest related to concrete call
-
readAll
Description copied from class:Deserializer
Returns string representation of the variables stored in the deserializer.- Specified by:
readAll
in classDeserializer
- Returns:
- string containing all variables
-
readArrayOfInts
- Overrides:
readArrayOfInts
in classDeserializer
-
readBoolean
Description copied from class:Deserializer
Reads value with the specified name asBoolean
.- Specified by:
readBoolean
in classDeserializer
- Parameters:
name
- name of the value to read- Returns:
- the value as
Boolean
-
readInt
Description copied from class:Deserializer
Reads value with the specified name asint
.- Specified by:
readInt
in classDeserializer
- Parameters:
name
- name of the value to read- Returns:
- the value as
int
-
readList
Description copied from class:Deserializer
Reads array with the specified name asList<valueType>
.- Overrides:
readList
in classDeserializer
- Parameters:
name
- name of the array to readvalueType
- type of the value to read- Returns:
- the value as
List<valueType>
-
readString
Description copied from class:Deserializer
Reads value with the specified name asString
.- Specified by:
readString
in classDeserializer
- Parameters:
name
- name of the value to read- Returns:
- the value as
String
-
readUUID
Description copied from class:Deserializer
Reads value with the specified name asUUID
.- Specified by:
readUUID
in classDeserializer
- Parameters:
name
- name of the value to read- Returns:
- the value as
UUID
-