Example usage for org.w3c.dom DOMException getLocalizedMessage

List of usage examples for org.w3c.dom DOMException getLocalizedMessage

Introduction

In this page you can find the example usage for org.w3c.dom DOMException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:com.freedomotic.plugins.devices.ipx800.Ipx800.java

private void valueTag(Document doc, Board board, Integer nl, String tag, int startingRelay) {
    for (int i = startingRelay; i < nl; i++) {
        try {/*ww w  .  j a va  2  s  . co m*/
            String tagName = tag + i;
            // control for storing value
            if (tag.equalsIgnoreCase("led")) {
                if (!(board.getRelayStatus(i) == Integer
                        .parseInt(doc.getElementsByTagName(tagName).item(0).getTextContent()))) {
                    sendChanges(i, board, doc.getElementsByTagName(tagName).item(0).getTextContent(), tag);
                    board.setRelayStatus(i,
                            Integer.parseInt(doc.getElementsByTagName(tagName).item(0).getTextContent()));
                }
            } else if (tag.equalsIgnoreCase("btn")) {
                if (!(board.getDigitalInputValue(i)
                        .equalsIgnoreCase(doc.getElementsByTagName(tagName).item(0).getTextContent()))) {
                    sendChanges(i, board, doc.getElementsByTagName(tagName).item(0).getTextContent(), tag);
                    board.setDigitalInputValue(i, doc.getElementsByTagName(tagName).item(0).getTextContent());
                }
            } else if (tag.equalsIgnoreCase("an") || tag.equalsIgnoreCase("analog")) {
                if (!(board.getAnalogInputValue(i) == Integer
                        .parseInt(doc.getElementsByTagName(tagName).item(0).getTextContent()))) {
                    sendChanges(i, board, doc.getElementsByTagName(tagName).item(0).getTextContent(), tag);
                    board.setAnalogInputValue(i,
                            Integer.parseInt(doc.getElementsByTagName(tagName).item(0).getTextContent()));
                }
            }
        } catch (DOMException domException) {
            LOG.error("DOMException " + domException.getLocalizedMessage());
        }
    }
}