Class JsonDeserializer
java.lang.Object
cz.metacentrum.perun.rpc.deserializer.Deserializer
cz.metacentrum.perun.rpc.deserializer.JsonDeserializer
Deserializer for JSON / JSONP data format.
 
Reads parameters from body (InputStream) of request which is typically POST. Doesn't read any parameters form URL!
While deserializing objects from JSON some of their properties may be ignored. They are not read from input and also not required to be present in input in order to match JSON object to the right Java object. They are set as NULL in Java object (if present as variable) or ignored at all.
- Author:
- Jan Klos invalid input: '<'ddd@mail.muni.cz>, Pavel Zlamal invalid input: '<'256627@mail.muni.cz>
- 
Constructor SummaryConstructorsConstructorDescriptionJsonDeserializer(jakarta.servlet.http.HttpServletRequest request) Create deserializer for JSON/JSONP data format.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturnstrueif value with the specified name is supplied.jakarta.servlet.http.HttpServletRequestReturn HttpServletRequest related to concrete call this deserializer is used to process.<T> TReads value from root Json node.<T> TReads value with the specified name asvalueType.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.intReads value with the specified name asint.<T> List<T> Reads array from root Json node.<T> List<T> Reads array with the specified name asList<valueType>.readListPerunBeans(String name) Reads array with the specified name asList<PerunBean>.readPerunBean(String name) Reads value with the specified name asPerunBean.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.DeserializerreadLocalDate, stateChangingCheck
- 
Constructor Details- 
JsonDeserializerCreate deserializer for JSON/JSONP data format.- Parameters:
- request- HttpServletRequest this deserializer is about to process
- Throws:
- IOException- if an IO error occurs
- RpcException- if content of- inis wrongly formatted
 
- 
JsonDeserializer- Throws:
- IOException
 
 
- 
- 
Method Details- 
containsDescription copied from class:DeserializerReturnstrueif value with the specified name is supplied.- Specified by:
- containsin class- Deserializer
- Parameters:
- name- name of the value to check
- Returns:
- trueif value with the specified name is supplied,- falseotherwise
 
- 
getServletRequestpublic jakarta.servlet.http.HttpServletRequest getServletRequest()Description copied from class:DeserializerReturn 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:
- getServletRequestin class- Deserializer
- Returns:
- HttpServletRequest related to concrete call
 
- 
readDescription copied from class:DeserializerReads value from root Json node.- Overrides:
- readin class- Deserializer
- Parameters:
- valueType- type of the value to read
- Returns:
- the value as valueType
 
- 
readDescription copied from class:DeserializerReads value with the specified name asvalueType.- Overrides:
- readin class- Deserializer
- Parameters:
- name- name of the value to read
- valueType- type of the value to read
- Returns:
- the value as valueType
 
- 
readAllDescription copied from class:DeserializerReturns string representation of the variables stored in the deserializer.- Specified by:
- readAllin class- Deserializer
- Returns:
- string containing all variables
 
- 
readArrayOfInts- Overrides:
- readArrayOfIntsin class- Deserializer
 
- 
readBooleanDescription copied from class:DeserializerReads value with the specified name asBoolean.- Specified by:
- readBooleanin class- Deserializer
- Parameters:
- name- name of the value to read
- Returns:
- the value as Boolean
 
- 
readIntDescription copied from class:DeserializerReads value with the specified name asint.- Specified by:
- readIntin class- Deserializer
- Parameters:
- name- name of the value to read
- Returns:
- the value as int
 
- 
readListDescription copied from class:DeserializerReads array from root Json node.- Overrides:
- readListin class- Deserializer
- Parameters:
- valueType- type of the value to read
- Returns:
- the value as List<valueType>
 
- 
readListDescription copied from class:DeserializerReads array with the specified name asList<valueType>.- Overrides:
- readListin class- Deserializer
- Parameters:
- name- name of the array to read
- valueType- type of the value to read
- Returns:
- the value as List<valueType>
 
- 
readListPerunBeansDescription copied from class:DeserializerReads array with the specified name asList<PerunBean>.- Overrides:
- readListPerunBeansin class- Deserializer
- Parameters:
- name- name of the array to read
- Returns:
- the value as List<PerunBean>
 
- 
readPerunBeanDescription copied from class:DeserializerReads value with the specified name asPerunBean.- Overrides:
- readPerunBeanin class- Deserializer
- Parameters:
- name- name of the value to read
- Returns:
- the value as PerunBean
 
- 
readStringDescription copied from class:DeserializerReads value with the specified name asString.- Specified by:
- readStringin class- Deserializer
- Parameters:
- name- name of the value to read
- Returns:
- the value as String
 
- 
readUUIDDescription copied from class:DeserializerReads value with the specified name asUUID.- Specified by:
- readUUIDin class- Deserializer
- Parameters:
- name- name of the value to read
- Returns:
- the value as UUID
 
 
-