Search in sources :

Example 1 with DataNode

use of com.cosylab.logging.engine.DataNode in project ACS by ACS-Community.

the class LogEntryXML method initBody.

private void initBody(Node log) throws DOMException {
    NodeList list = log.getChildNodes();
    for (int i = 0; i < list.getLength(); i++) {
        Node node = list.item(i);
        boolean isData = node.getNodeName().equals("Data");
        short type = node.getNodeType();
        if (isData) {
            DataNode dataNode = new DataNode(node);
            if (datas == null) {
                datas = new VectorNodeList(1, 2);
            }
            datas.add(dataNode);
        } else {
            if (isLogEntrySimple) {
                isLogEntrySimple = !node.hasChildNodes();
            }
            if (isLogEntrySimple) {
                // simpleLogEntryMessage = node.getNodeValue();
                setField(LogField.LOGMESSAGE, node.getNodeValue());
            } else {
                if (complexLogEntryMessage == null)
                    complexLogEntryMessage = new VectorNodeList(1, 2);
                complexLogEntryMessage.add(node);
            }
        }
    }
}
Also used : VectorNodeList(com.cosylab.logging.engine.VectorNodeList) DataNode(com.cosylab.logging.engine.DataNode) NodeList(org.w3c.dom.NodeList) VectorNodeList(com.cosylab.logging.engine.VectorNodeList) DataNode(com.cosylab.logging.engine.DataNode) Node(org.w3c.dom.Node)

Aggregations

DataNode (com.cosylab.logging.engine.DataNode)1 VectorNodeList (com.cosylab.logging.engine.VectorNodeList)1 Node (org.w3c.dom.Node)1 NodeList (org.w3c.dom.NodeList)1