- return model;
- }
-
- private void parseNode(Node node, NamedQueryArtifact model) {
- if (node.getNodeName().equalsIgnoreCase(NAMED_QUERY_VERSION_ID)) {
- model.setNamedQueryUuid(node.getTextContent().trim());
- }
- else if (node.getNodeName().equalsIgnoreCase(RELATIONSHIP_DATA)) {
- parseRelationshipNode(node, model);
- }
- else {
- NodeList nodeList = node.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node childNode = nodeList.item(i);
- parseNode(childNode, model);
- }
- }
- }
-
- private void parseRelationshipNode(Node node, NamedQueryArtifact model) {
- String key = null;
- String value = null;
-
- NodeList nodeList = node.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node childNode = nodeList.item(i);
- if (childNode.getNodeName().equalsIgnoreCase(RELATIONSHIP_KEY)) {
- key = childNode.getTextContent().trim();
- }
- else if (childNode.getNodeName().equalsIgnoreCase(RELATIONSHIP_VALUE)) {
- value = childNode.getTextContent().trim();
- }