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 invalid input: '<'ddd@mail.muni.cz>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif value with the specified name is supplied.<T> TReads value asvalueType.<T> TReads value with the specified name asvalueType.int[]int[]readArrayOfInts(String name) intreadInt()Reads value asint.intReads 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-InputStreamto read JSON data from- Throws:
IOException- if an IO error occursRpcException- if content ofinis wrongly formatted
-
-
Method Details
-
contains
Description copied from class:DeserializerReturnstrueif value with the specified name is supplied.- Specified by:
containsin classDeserializer- Parameters:
name- name of the value to check- Returns:
trueif value with the specified name is supplied,falseotherwise
-
read
Description copied from class:DeserializerReads value with the specified name asvalueType.- Overrides:
readin 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:DeserializerReads value asvalueType.- Overrides:
readin classDeserializer- Parameters:
valueType- type of the value to read- Returns:
- the value as
valueType
-
readArrayOfInts
- Overrides:
readArrayOfIntsin classDeserializer
-
readArrayOfInts
public int[] readArrayOfInts()- Overrides:
readArrayOfIntsin classDeserializer
-
readInt
Description copied from class:DeserializerReads value with the specified name asint.- Specified by:
readIntin classDeserializer- Parameters:
name- name of the value to read- Returns:
- the value as
int
-
readInt
public int readInt()Description copied from class:DeserializerReads value asint.- Specified by:
readIntin classDeserializer- Returns:
- the value as
int
-
readList
Description copied from class:DeserializerReads array with the specified name asList<valueType>.- Overrides:
readListin 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:DeserializerReads an arrayList<valueType>.- Overrides:
readListin classDeserializer- Parameters:
valueType- type of the value to read- Returns:
- the value as
List<valueType>
-
readString
Description copied from class:DeserializerReads value with the specified name asString.- Specified by:
readStringin classDeserializer- Parameters:
name- name of the value to read- Returns:
- the value as
String
-
readString
Description copied from class:DeserializerReads value asString.- Specified by:
readStringin classDeserializer- Returns:
- the value as
String
-