Package cz.metacentrum.perun.rpclib.impl
Class JsonDeserializer
java.lang.Object
cz.metacentrum.perun.rpclib.api.Deserializer
cz.metacentrum.perun.rpclib.impl.JsonDeserializer
Deserializer that reads values from JSON content.
- Since:
- 0.1
- Author:
- Jan Klos <ddd@mail.muni.cz>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if value with the specified name is supplied.<T> T
Reads value asvalueType
.<T> T
Reads value with the specified name asvalueType
.int[]
int[]
readArrayOfInts
(String name) int
readInt()
Reads value asint
.int
Reads value with the specified name asint
.<T> List<T>
Reads an arrayList<valueType>
.<T> List<T>
Reads array with the specified name asList<valueType>
.Reads value asString
.readString
(String name) Reads value with the specified name asString
.
-
Constructor Details
-
JsonDeserializer
- Parameters:
in
-InputStream
to read JSON data from- Throws:
IOException
- if an IO error occursRpcException
- if content ofin
is wrongly formatted
-
-
Method Details
-
contains
Description copied from class:Deserializer
Returnstrue
if value with the specified name is supplied.- 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
-
read
Description copied from class:Deserializer
Reads value with the specified name asvalueType
.- Overrides:
read
in classDeserializer
- Parameters:
name
- name of the value to readvalueType
- type of the value to read- Returns:
- the value as
valueType
-
read
Description copied from class:Deserializer
Reads value asvalueType
.- Overrides:
read
in classDeserializer
- Parameters:
valueType
- type of the value to read- Returns:
- the value as
valueType
-
readArrayOfInts
- Overrides:
readArrayOfInts
in classDeserializer
-
readArrayOfInts
public int[] readArrayOfInts()- Overrides:
readArrayOfInts
in classDeserializer
-
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
-
readInt
public int readInt()Description copied from class:Deserializer
Reads value asint
.- Specified by:
readInt
in classDeserializer
- 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>
-
readList
Description copied from class:Deserializer
Reads an arrayList<valueType>
.- Overrides:
readList
in classDeserializer
- Parameters:
valueType
- 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
-
readString
Description copied from class:Deserializer
Reads value asString
.- Specified by:
readString
in classDeserializer
- Returns:
- the value as
String
-