private <T extends GraphElement> T create(Node node, GraphElement parent) {
return create(node, parent, node.getNodeName());
}
private <T extends GraphElement> T create(Node node, GraphElement parent, String nodeType) {
GraphElement element = JpdlVersionRegistry.getElementTypeDefinition(jpdlVersion, nodeType).createElement();
if (parent != null) {
parent.addChild(element);
}
if (element instanceof NamedGraphElement) {
((NamedGraphElement) element).setName(getAttribute(node, NAME_ATTR));
}
NodeList nodeList = node.getChildNodes();
for (int j = 0; j < nodeList.getLength(); j++) {
Node childNode = nodeList.item(j);
if (DESCRIPTION_NODE.equals(childNode.getNodeName()) && element instanceof Describable) {
((Describable) element).setDescription(getTextContent(childNode));
}
if (DELEGATION_NODE.equals(childNode.getNodeName())) {
((Delegable) element).setDelegationClassName(getAttribute(childNode, CLASS_ATTR));
element.setDelegationConfiguration(getTextContent(childNode));
}
if (TRANSITION_NODE.equals(childNode.getNodeName())) {
parseTransition(childNode, element);
}
if (ACTION_NODE.equals(childNode.getNodeName())) {