Package org.openhab.core.transform

Examples of org.openhab.core.transform.TransformationService.transform()


  public static String transform(String type, String function, String value) {
    String result;
    TransformationService service = TransformationHelper.getTransformationService(TransformationActivator.getContext(), type);
    if(service!=null) {
      try {
        result = service.transform(function, value);
      } catch (TransformationException e) {
        logger.error("Error executing the transformation '" + type + "': " + e.getMessage());
        result = value;
      }     
    } else {
View Full Code Here


      String transformationFunction = parts[1];

      TransformationService transformationService =
          TransformationHelper.getTransformationService(TCPActivator.getContext(), transformationType);
      if (transformationService != null) {
        transformedResponse = transformationService.transform(transformationFunction, response);
      } else {
        transformedResponse = response;
        logger.warn("couldn't transform response because transformationService of type '{}' is unavailable", transformationType);
      }
    }
View Full Code Here

        TransformationService transformationService = TransformationHelper
            .getTransformationService(
                OpenEnergyMonitorActivator.getContext(),
                transformationType);
        if (transformationService != null) {
          transformedResponse = transformationService.transform(
              transformationFunction, String.valueOf(data));
        } else {
          logger.warn(
              "couldn't transform response because transformationService of type '{}' is unavailable",
              transformationType);
View Full Code Here

      String transformationFunction = parts[1];

      TransformationService transformationService =
          TransformationHelper.getTransformationService(TCPActivator.getContext(), transformationType);
      if (transformationService != null) {
        transformedResponse = transformationService.transform(transformationFunction, response);
      } else {
        transformedResponse = response;
        logger.warn("couldn't transform response because transformationService of type '{}' is unavailable", transformationType);
      }
    }
View Full Code Here

        String value = matcher.group(3);
        TransformationService transformation =
          TransformationHelper.getTransformationService(UIActivator.getContext(), type);
        if(transformation!=null) {
          try {
            label = label.substring(0, label.indexOf("[")+1) + transformation.transform(pattern, value) + "]";
          } catch (TransformationException e) {
            logger.error("transformation throws exception [transformation="
                + transformation + ", value=" + value + "]", e);
            label = label.substring(0, label.indexOf("[")+1) + value + "]";
          }
View Full Code Here

              String transformationFunction = parts[1];
             
              TransformationService transformationService =
                TransformationHelper.getTransformationService(ExecActivator.getContext(), transformationType);
              if (transformationService != null) {
                transformedResponse = transformationService.transform(transformationFunction, response);
              } else {
                transformedResponse = response;
                logger.warn("couldn't transform response because transformationService of type '{}' is unavailable", transformationType);
              }
            }
View Full Code Here

              String transformationFunction = parts[1];
             
              TransformationService transformationService =
                TransformationHelper.getTransformationService(HttpActivator.getContext(), transformationType);
              if (transformationService != null) {
                transformedResponse = transformationService.transform(transformationFunction, response);
              } else {
                transformedResponse = response;
                logger.warn("couldn't transform response because transformationService of type '{}' is unavailable", transformationType);
              }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.