private void initComponents() { System.out.println(getClass().getSimpleName() + ": Init Components..."); List<?> componentNodes = components.selectNodes("//dataroot/Components"); for (Object o : componentNodes) { Node node = (Node) o; String msgID = getSingleNodeTextSafe(node, "MsgID"); String componentName = getSingleNodeTextSafe(node, "ComponentName"); String componentType = getSingleNodeTextSafe(node, "ComponentType"); String category = getSingleNodeTextSafe(node, "Category"); String notReqXML = getSingleNodeTextSafe(node, "NotReqXML"); allComponents.put(componentName, new Component(msgID, componentName, componentType, category, notReqXML)); } System.out.println(getClass().getSimpleName() + ": " + allComponents.size() + " Components found"); // Add msgContents for (Component component : allComponents.values()) { addComponentMsgContent(component, "\t"); } }
private void initComponents() { System.out.println(getClass().getSimpleName() + ": Init Components..."); List<?> componentNodes = components.selectNodes("//dataroot/Components"); for (Object o : componentNodes) { Node node = (Node) o; String msgID = getSingleNodeTextSafe(node, "MsgID"); String componentName = getSingleNodeTextSafe(node, "ComponentName"); String componentType = getSingleNodeTextSafe(node, "ComponentType"); String category = getSingleNodeTextSafe(node, "Category"); String notReqXML = getSingleNodeTextSafe(node, "NotReqXML"); allComponents.put(componentName, new Component(msgID, componentName, componentType, category, notReqXML)); } System.out.println(getClass().getSimpleName() + ": " + allComponents.size() + " Components found"); // Add msgContents for (Component component : allComponents.values()) { addComponentMsgContent(component, "\t"); } }
private void initComponents() { System.out.println(getClass().getSimpleName() + ": Init Components..."); List<?> componentNodes = components.selectNodes("//dataroot/Components"); for (Object o : componentNodes) { Node node = (Node) o; String msgID = getSingleNodeTextSafe(node, "MsgID"); String componentName = getSingleNodeTextSafe(node, "ComponentName"); String componentType = getSingleNodeTextSafe(node, "ComponentType"); String category = getSingleNodeTextSafe(node, "Category"); String notReqXML = getSingleNodeTextSafe(node, "NotReqXML"); allComponents.put(componentName, new Component(msgID, componentName, componentType, category, notReqXML)); } System.out.println(getClass().getSimpleName() + ": " + allComponents.size() + " Components found"); // Add msgContents for (Component component : allComponents.values()) { addComponentMsgContent(component, "\t"); } }
private void addComponentMsgContent(Component component, String prefix) { List<?> msgContentsNodes = getMsgContents(component.getMsgID()); System.out.println(prefix + " " + component.getName()); if (!component.getMsgContent().isEmpty()) { System.out.println(prefix + "\talready handled, return"); return; } for (Object o : msgContentsNodes) { Node node = (Node) o; String tagText = getSingleNodeTextSafe(node, "TagText"); String reqd = getSingleNodeTextSafe(node, "Reqd"); if (allFields.containsKey(tagText)) { ComponentField componentField = new ComponentField(allFields.get(tagText), reqd); component.addMsgContent(componentField); System.out.println(prefix + "\t " + allFields.get(tagText).getFieldName()); } else if (allComponents.containsKey(tagText)) { // Handle msgContents for the component in question first! addComponentMsgContent(allComponents.get(tagText), prefix + "\t"); ComponentComponent componentComponent = new ComponentComponent(allComponents.get(tagText), reqd); component.addMsgContent(componentComponent); System.out.println(prefix + "\t " + allComponents.get(tagText).getName()); } else { System.err.println("Could not find tagText: " + tagText); } } }
private void addComponentMsgContent(Component component, String prefix) { List<?> msgContentsNodes = getMsgContents(component.getMsgID()); System.out.println(prefix + " " + component.getName()); if (!component.getMsgContent().isEmpty()) { System.out.println(prefix + "\talready handled, return"); return; } for (Object o : msgContentsNodes) { Node node = (Node) o; String tagText = getSingleNodeTextSafe(node, "TagText"); String reqd = getSingleNodeTextSafe(node, "Reqd"); if (allFields.containsKey(tagText)) { ComponentField componentField = new ComponentField(allFields.get(tagText), reqd); component.addMsgContent(componentField); System.out.println(prefix + "\t " + allFields.get(tagText).getFieldName()); } else if (allComponents.containsKey(tagText)) { // Handle msgContents for the component in question first! addComponentMsgContent(allComponents.get(tagText), prefix + "\t"); ComponentComponent componentComponent = new ComponentComponent(allComponents.get(tagText), reqd); component.addMsgContent(componentComponent); System.out.println(prefix + "\t " + allComponents.get(tagText).getName()); } else { System.err.println("Could not find tagText: " + tagText); } } }
private void initComponents() { System.out.println(getClass().getSimpleName() + ": Init Components..."); List<?> componentNodes = components.selectNodes("//dataroot/Components"); for (Object o : componentNodes) { Node node = (Node) o; String msgID = node.selectSingleNode("MsgID").getText(); String componentName = node.selectSingleNode("ComponentName").getText(); String componentType = node.selectSingleNode("ComponentType").getText(); String category = node.selectSingleNode("Category").getText(); String notReqXML = node.selectSingleNode("NotReqXML").getText(); allComponents.put(componentName, new Component(msgID, componentName, componentType, category, notReqXML)); } System.out.println(getClass().getSimpleName() + ": " + allComponents.size() + " Components found"); // Add msgContents for (Component component : allComponents.values()) { addComponentMsgContent(component, "\t"); } }
private void addComponentMsgContent(Component component, String prefix) { List<?> msgContentsNodes = getMsgContents(component.getMsgID()); System.out.println(prefix + " " + component.getName()); if (!component.getMsgContent().isEmpty()) { System.out.println(prefix + "\talready handled, return"); return; } for (Object o : msgContentsNodes) { Node node = (Node) o; String tagText = getSingleNodeTextSafe(node, "TagText"); String reqd = getSingleNodeTextSafe(node, "Reqd"); if (allFields.containsKey(tagText)) { ComponentField componentField = new ComponentField(allFields.get(tagText), reqd); component.addMsgContent(componentField); System.out.println(prefix + "\t " + allFields.get(tagText).getFieldName()); } else if (allComponents.containsKey(tagText)) { // Handle msgContents for the component in question first! addComponentMsgContent(allComponents.get(tagText), prefix + "\t"); ComponentComponent componentComponent = new ComponentComponent(allComponents.get(tagText), reqd); component.addMsgContent(componentComponent); System.out.println(prefix + "\t " + allComponents.get(tagText).getName()); } else { System.err.println("Could not find tagText: " + tagText); } } }
private void addComponentMsgContent(Component component, String prefix) { List<?> msgContentsNodes = getMsgContents(component.getMsgID()); System.out.println(prefix + " " + component.getName()); if (!component.getMsgContent().isEmpty()) { System.out.println(prefix + "\talready handled, return"); return; } for (Object o : msgContentsNodes) { Node node = (Node) o; String tagText = node.selectSingleNode("TagText").getText(); String reqd = node.selectSingleNode("Reqd").getText(); if (allFields.containsKey(tagText)) { ComponentField componentField = new ComponentField(allFields.get(tagText), reqd); component.addMsgContent(componentField); System.out.println(prefix + "\t " + allFields.get(tagText).getFieldName()); } else if (allComponents.containsKey(tagText)) { // Handle msgContents for the component in question first! addComponentMsgContent(allComponents.get(tagText), prefix + "\t"); ComponentComponent componentComponent = new ComponentComponent(allComponents.get(tagText), reqd); component.addMsgContent(componentComponent); System.out.println(prefix + "\t " + allComponents.get(tagText).getName()); } else { System.err.println("Could not find tagText: " + tagText); } } }