Class ModelOutputConverter
java.lang.Object
de.iip_ecosphere.platform.connectors.model.ModelOutputConverter
- All Implemented Interfaces:
OutputFormatter.OutputConverter<Object>
Output converter implementing the
ModelAccess conversion conventions. An
output converter for ModelAccess shall allow for more homogeneous generated
code compared to OutputFormatter-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 TypeMethodDescriptionfromBigDecimal(BigDecimal data) Converts data fromBigDecimalto the output format.fromBigInteger(BigInteger data) Converts data fromBigIntegerto the output format.fromBoolean(boolean data) Converts data from Boolean to the output format.fromByte(byte data) Converts data from byte to the output format.fromByteArray(byte[] data) Converts data from a byte array to the output format.Converts data from a date to the output format.fromDouble(double data) Converts data from double to the output format.fromDoubleArray(double[] data) Converts data from a double array to the output format.<E> ObjectfromElementList(List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> data) Converts data from an object the output format.fromFloat(float data) Converts data from float to the output format.fromInteger(int data) Converts data from int to the output format.fromIntegerArray(int[] data) Converts data from an integer array to the output format.Converts data from an object the output format.fromLong(long data) Converts data from long to the output format.fromObject(Object data) Converts data from an object the output format.fromShort(short data) Converts data from short to the output format.fromString(String data) Converts data from String to the output format.fromStringArray(String[] data) Converts data from a string array to the output format.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.formatter.OutputFormatter.OutputConverter
fromEnum, fromEnumAsName, fromLocalDateTime
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ModelOutputConverter
protected ModelOutputConverter()Prevents external creation.
-
-
Method Details
-
fromInteger
Description copied from interface:OutputFormatter.OutputConverterConverts data from int to the output format.- Specified by:
fromIntegerin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromByte
Description copied from interface:OutputFormatter.OutputConverterConverts data from byte to the output format.- Specified by:
fromBytein interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromLong
Description copied from interface:OutputFormatter.OutputConverterConverts data from long to the output format.- Specified by:
fromLongin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromShort
Description copied from interface:OutputFormatter.OutputConverterConverts data from short to the output format.- Specified by:
fromShortin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromString
Description copied from interface:OutputFormatter.OutputConverterConverts data from String to the output format.- Specified by:
fromStringin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromDouble
Description copied from interface:OutputFormatter.OutputConverterConverts data from double to the output format.- Specified by:
fromDoublein interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromFloat
Description copied from interface:OutputFormatter.OutputConverterConverts data from float to the output format.- Specified by:
fromFloatin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromBoolean
Description copied from interface:OutputFormatter.OutputConverterConverts data from Boolean to the output format.- Specified by:
fromBooleanin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromIntegerArray
Description copied from interface:OutputFormatter.OutputConverterConverts data from an integer array to the output format.- Specified by:
fromIntegerArrayin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromDoubleArray
Description copied from interface:OutputFormatter.OutputConverterConverts data from a double array to the output format.- Specified by:
fromDoubleArrayin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromStringArray
Description copied from interface:OutputFormatter.OutputConverterConverts data from a string array to the output format.- Specified by:
fromStringArrayin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromByteArray
Description copied from interface:OutputFormatter.OutputConverterConverts data from a byte array to the output format.- Specified by:
fromByteArrayin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromDate
Description copied from interface:OutputFormatter.OutputConverterConverts data from a date to the output format.- Specified by:
fromDatein interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the dateformat- the target date format (seeSimpleDateFormat)- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromObject
Description copied from interface:OutputFormatter.OutputConverterConverts data from an object the output format. [fallback dummy]- Specified by:
fromObjectin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromList
Description copied from interface:OutputFormatter.OutputConverterConverts data from an object the output format.- Specified by:
fromListin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromElementList
public <E> Object fromElementList(List<de.iip_ecosphere.platform.transport.serialization.QualifiedElement<E>> data) throws IOException Description copied from interface:OutputFormatter.OutputConverterConverts data from an object the output format.- Specified by:
fromElementListin interfaceOutputFormatter.OutputConverter<Object>- Type Parameters:
E- the element type- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromBigInteger
Description copied from interface:OutputFormatter.OutputConverterConverts data fromBigIntegerto the output format.- Specified by:
fromBigIntegerin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-
fromBigDecimal
Description copied from interface:OutputFormatter.OutputConverterConverts data fromBigDecimalto the output format.- Specified by:
fromBigDecimalin interfaceOutputFormatter.OutputConverter<Object>- Parameters:
data- the data- Returns:
- the converted output format
- Throws:
IOException- if conversion fails
-