Class ModelInputConverter
java.lang.Object
de.iip_ecosphere.platform.connectors.model.ModelInputConverter
- All Implemented Interfaces:
InputParser.InputConverter<Object>
Input converter implementing the
ModelAccess conversion conventions. An
input converter for ModelAccess shall allow for more homogeneous generated
code compared to InputParser-based code. Moreover, this shall allow for
encapsulating future changes to input/output conventions for ModelAccess.- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoBigDecimal(Object data) Converts parsed data returned byInputParser.ParseResultto aBigDecimal.toBigInteger(Object data) Converts parsed data returned byInputParser.ParseResultto aBigInteger.booleanConverts parsed data returned byInputParser.ParseResultto Boolean.byteConverts parsed data returned byInputParser.ParseResultto byte.byte[]toByteArray(Object data) Converts parsed data returned byInputParser.ParseResultto a byte array.doubleConverts parsed data returned byInputParser.ParseResultto double.double[]toDoubleArray(Object data) Converts parsed data returned byInputParser.ParseResultto a double array.<E> List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> toElementList(Object data, Class<E> eltCls) Converts parsed data returned byInputParser.ParseResultto a list instance.floatConverts parsed data returned byInputParser.ParseResultto float.floattoFloatIndex(Object data) Converts parsed index data returned byInputParser.ParseResultto float.intConverts parsed data returned byInputParser.ParseResultto integer.int[]toIntegerArray(Object data) Converts parsed data returned byInputParser.ParseResultto an integer array.<E> List<E> Converts parsed data returned byInputParser.ParseResultto a list instance.longConverts parsed data returned byInputParser.ParseResultto long.longtoLongIndex(Object data) Converts parsed index data returned byInputParser.ParseResultto long.Converts parsed data returned byInputParser.ParseResultto an object.shortConverts parsed data returned byInputParser.ParseResultto short.Converts parsed data returned byInputParser.ParseResultto String.String[]toStringArray(Object 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
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ModelInputConverter
protected ModelInputConverter()Prevents external creation.
-
-
Method Details
-
toInteger
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto integer.- Specified by:
toIntegerin interfaceInputParser.InputConverter<Object>- 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<Object>- 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<Object>- 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<Object>- 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<Object>- 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<Object>- 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<Object>- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
IOException- if conversion fails
-
toBoolean
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto Boolean.- Specified by:
toBooleanin interfaceInputParser.InputConverter<Object>- Parameters:
data- the obtained data- Returns:
- the converted Boolean
- Throws:
IOException- if conversion fails
-
toIntegerArray
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto an integer array.- Specified by:
toIntegerArrayin interfaceInputParser.InputConverter<Object>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
IOException- if conversion fails
-
toDoubleArray
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a double array.- Specified by:
toDoubleArrayin interfaceInputParser.InputConverter<Object>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toStringArray
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a String array.- Specified by:
toStringArrayin interfaceInputParser.InputConverter<Object>- Parameters:
data- the obtained data- Returns:
- the converted integer array
- Throws:
IOException- if conversion fails
-
toByteArray
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a byte array.- Specified by:
toByteArrayin interfaceInputParser.InputConverter<Object>- 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<Object>- Parameters:
data- the obtained data- Returns:
- the converted double array
- Throws:
IOException- if conversion fails
-
toList
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto a list instance.- Specified by:
toListin interfaceInputParser.InputConverter<Object>- 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(Object 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<Object>- 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
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto aBigInteger.- Specified by:
toBigIntegerin interfaceInputParser.InputConverter<Object>- Parameters:
data- the obtained data- Returns:
- the converted
BigInteger - Throws:
IOException- if conversion fails
-
toBigDecimal
Description copied from interface:InputParser.InputConverterConverts parsed data returned byInputParser.ParseResultto aBigDecimal.- Specified by:
toBigDecimalin interfaceInputParser.InputConverter<Object>- Parameters:
data- the obtained data- Returns:
- the converted
BigDecimal - Throws:
IOException- if conversion fails
-
toLongIndex
Description copied from interface:InputParser.InputConverterConverts parsed index data returned byInputParser.ParseResultto long.- Specified by:
toLongIndexin interfaceInputParser.InputConverter<Object>- Parameters:
data- the obtained data- Returns:
- the converted integer
- Throws:
IOException- if conversion fails
-
toFloatIndex
Description copied from interface:InputParser.InputConverterConverts parsed index data returned byInputParser.ParseResultto float.- Specified by:
toFloatIndexin interfaceInputParser.InputConverter<Object>- Parameters:
data- the obtained data- Returns:
- the converted float
- Throws:
IOException- if conversion fails
-