Package org.openhab.core.transform
Interface TransformationService
- All Known Implementing Classes:
AbstractFileTransformationService
,ScriptTransformationService
@NonNullByDefault
public interface TransformationService
A TransformationProcessor transforms a given input and returns the transformed
result. Transformations could make sense in various situations, for example:
- extract certain informations from a weather forecast website
- extract the status of your TV which provides it's status on a webpage
- postprocess the output from a serial device to be human readable
- Author:
- Thomas Eichstaedt-Engelen - Initial contribution, Kai Kreuzer - Initial contribution
-
Field Details
-
SERVICE_PROPERTY_NAME
- See Also:
-
SERVICE_PROPERTY_LABEL
- See Also:
-
TRANSFORM_FOLDER_NAME
- See Also:
-
TRANSFORM_PROFILE_SCOPE
- See Also:
-
-
Method Details
-
transform
Transforms the inputsource
by means of the givenfunction
and returns the transformed output. The transformation may returnnull
to express its operation resulted in anull
output. In case of any error aTransformationException
should be thrown.- Parameters:
function
- the function to be used to transform the inputsource
- the input to be transformed- Returns:
- the transformed result or
null
if the transformation's output isnull
. - Throws:
TransformationException
- if any error occurs
-