Class JsonInputParser.JsonInputConverter
java.lang.Object
de.iip_ecosphere.platform.connectors.parser.JsonInputParser.JsonInputConverter
- All Implemented Interfaces:
InputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>
- Enclosing class:
JsonInputParser
public static final class JsonInputParser.JsonInputConverter
extends Object
implements InputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>
Implements a JSON input converter.
- Author:
- Holger Eichelberger, SSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoBigDecimal(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto aBigDecimal.toBigInteger(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto aBigInteger.booleantoBoolean(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto Boolean.bytetoByte(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto byte.byte[]toByteArray(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto a byte array.doubletoDouble(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto double.double[]toDoubleArray(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto a double array.<E> List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> toElementList(de.iip_ecosphere.platform.support.json.JsonIterator data, Class<E> eltCls) Converts parsed data returned byInputParser.ParseResultto a list instance.floattoFloat(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto float.inttoInteger(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto integer.int[]toIntegerArray(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto an integer array.<E> List<E> Converts parsed data returned byInputParser.ParseResultto a list instance.longtoLong(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto long.toObject(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto an object.shorttoShort(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto short.toString(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto String.String[]toStringArray(de.iip_ecosphere.platform.support.json.JsonIterator data) Converts parsed data returned byInputParser.ParseResultto a String array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.connectors.parser.InputParser.InputConverter
toDate, toEnum, toLocalDateTime
-
Constructor Details
-
JsonInputConverter
public JsonInputConverter()
-
-
Method Details
-
toInteger
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto integer.- Specified by:
toIntegerin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toByte
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto byte.- Specified by:
toBytein interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toLong
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto long.- Specified by:
toLongin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
IOException- if conversion fails
-
toShort
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto short.- Specified by:
toShortin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted long
- Throws:
IOException- if conversion fails
-
toString
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto String.- Specified by:
toStringin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted String
- Throws:
IOException- if conversion fails
-
toDouble
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto double.- Specified by:
toDoublein interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted double
- Throws:
IOException- if conversion fails
-
toFloat
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto float.- Specified by:
toFloatin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
IOException- if conversion fails
-
toBoolean
public boolean toBoolean(de.iip_ecosphere.platform.support.json.JsonIterator data) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto Boolean.- Specified by:
toBooleanin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted Boolean
- Throws:
IOException- if conversion fails
-
toIntegerArray
public int[] toIntegerArray(de.iip_ecosphere.platform.support.json.JsonIterator data) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto an integer array.- Specified by:
toIntegerArrayin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
IOException- if conversion fails
-
toStringArray
public String[] toStringArray(de.iip_ecosphere.platform.support.json.JsonIterator data) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a String array.- Specified by:
toStringArrayin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
IOException- if conversion fails
-
toDoubleArray
public double[] toDoubleArray(de.iip_ecosphere.platform.support.json.JsonIterator data) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a double array.- Specified by:
toDoubleArrayin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toByteArray
public byte[] toByteArray(de.iip_ecosphere.platform.support.json.JsonIterator data) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a byte array.- Specified by:
toByteArrayin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toObject
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto an object. [fallback dummy]- Specified by:
toObjectin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toList
public <E> List<E> toList(de.iip_ecosphere.platform.support.json.JsonIterator data, Class<E> eltCls) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a list instance.- Specified by:
toListin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Type Parameters:
E- the element type- Parameters:
data- the obtained dataeltCls- the element type class- Returns:
- the converted list instance
- Throws:
IOException- if the conversion fails
-
toElementList
public <E> List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> toElementList(de.iip_ecosphere.platform.support.json.JsonIterator data, Class<E> eltCls) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a list instance.- Specified by:
toElementListin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Type Parameters:
E- the element type- Parameters:
data- the obtained dataeltCls- the element type class- Returns:
- the converted list instance
- Throws:
IOException- if the conversion fails
-
toBigInteger
public BigInteger toBigInteger(de.iip_ecosphere.platform.support.json.JsonIterator data) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto aBigInteger.- Specified by:
toBigIntegerin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted
BigInteger - Throws:
IOException- if conversion fails
-
toBigDecimal
public BigDecimal toBigDecimal(de.iip_ecosphere.platform.support.json.JsonIterator data) throws IOException Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto aBigDecimal.- Specified by:
toBigDecimalin interfaceInputParser.InputConverter<de.iip_ecosphere.platform.support.json.JsonIterator>- Parameters:
data- the obtained data- Returns:
- the converted
BigDecimal - Throws:
IOException- if conversion fails
-