Package org.openhab.binding.insteonplm.internal.utils.Utils

Examples of org.openhab.binding.insteonplm.internal.utils.Utils.ParsingException


            messageMap.put(msgDef.getKey(), msgDef.getValue());
          }
        }
      }
    } catch (SAXException e) {
      throw new ParsingException("Failed to parse XML!", e);
    } catch (ParserConfigurationException e) {
      throw new ParsingException("Got parser config exception! ", e);
    }
    return messageMap;
  }
View Full Code Here


          offset += field.getKey().getType().getSize();
        }
      }
    }
    if (offset != length) {
      throw new ParsingException(
        "Actual msg length " + offset + " differs from given msg length " + length + "!");
    }
    if (length == 0) length = offset;
   
    return new Pair<String, Msg>(name, s_createMsg(fieldMap, length, hlength, direction));
View Full Code Here

          fields.put(definition.getKey(),  definition.getValue());
        }
      }
    }
    if (headerLen != offset) {
      throw new ParsingException("Actual header length " + offset + " differs from given length " + headerLen + "!");
    }
    return headerLen;
  }
View Full Code Here

          Element e = (Element) node;
          if (e.getTagName().equals("feature")) features.add(s_parseFeature(e));
        }
      }
    } catch (SAXException e) {
      throw new ParsingException("Failed to parse XML!", e);
    } catch (ParserConfigurationException e) {
      throw new ParsingException("Got parser config exception! ", e);
    }
    return features;
  }
View Full Code Here

   
    return feature;
  }
  private static void s_parseMessageHandler(Element e, FeatureTemplate f) throws DOMException, ParsingException {
    String handler = e.getTextContent();
    if (handler == null) throw new ParsingException("Could not find MessageHandler for: " + e.getTextContent());
    if (e.getAttribute("default").equals("true")) {
      f.setDefaultMessageHandler(handler);
    } else {
      int command = Utils.from0xHexString(e.getAttribute("cmd"));
      f.addMessageHandler(command, handler);
View Full Code Here

      f.addMessageHandler(command, handler);
    }
  }
  private static void s_parseCommandHandler(Element e, FeatureTemplate f) throws ParsingException {
    String handler = e.getTextContent();
    if (handler == null) throw new ParsingException("Could not find CommandHandler for: " + e.getTextContent());
    if (e.getAttribute("default").equals("true")) {
      f.setDefaultCommandHandler(handler);
    } else {
      Class<? extends Command> command = s_parseCommandClass(e.getAttribute("command"));
      f.addCommandHandler(command, handler);
View Full Code Here

      f.addCommandHandler(command, handler);
    }
  }
  private static void s_parseMessageDispatcher(Element e, FeatureTemplate f) throws DOMException, ParsingException {
    String dispatcher = e.getTextContent();
    if (dispatcher == null) throw new ParsingException("Could not find MessageDispatcher for: " + e.getTextContent());
    f.setMessageDispatcher(dispatcher);
  }
View Full Code Here

    if (dispatcher == null) throw new ParsingException("Could not find MessageDispatcher for: " + e.getTextContent());
    f.setMessageDispatcher(dispatcher);
  }
  private static void s_parsePollHandler(Element e, FeatureTemplate f) throws ParsingException {
    String pollHandler = e.getTextContent();
    if (pollHandler == null) throw new ParsingException("Could not find PollHandler: " + pollHandler);
    f.setPollHandler(pollHandler);
  }
View Full Code Here

 
  private static Class<? extends Command> s_parseCommandClass(String c) throws ParsingException {
    if (c.equals("OnOffType")) return OnOffType.class;
    else if (c.equals("PercentType")) return PercentType.class;
    else if (c.equals("DecimalType")) return DecimalType.class;
    else throw new ParsingException("Unknown Command Type");
  }
View Full Code Here

TOP

Related Classes of org.openhab.binding.insteonplm.internal.utils.Utils.ParsingException

Copyright © 2018 www.massapicom. 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.