public static String getFullyQualifiedName(Colon2Node node) { StringBuilder name = new StringBuilder(); Node left = node.getLeftNode(); if (left instanceof Colon2Node) { name.append(getFullyQualifiedName((Colon2Node) left)); } else if (left instanceof ConstNode) { name.append(((ConstNode) left).getName()); } name.append(NAMESPACE_DELIMETER).append(node.getName()); return name.toString(); }
public static String getFullyQualifiedName(Node node) { if (node == null) { return EMPTY_STRING; } if (node instanceof ConstNode) { return ((ConstNode) node).getName(); } if (node instanceof Colon2Node) { Colon2Node colonNode = (Colon2Node) node; String prefix = getFullyQualifiedName(colonNode.getLeftNode()); if (prefix.length() > 0) { prefix = prefix + NAMESPACE_DELIMETER; } return prefix + colonNode.getName(); } return getName(node); }