Represents a node.
| 37 | * Represents a node. |
| 38 | */ |
| 39 | public class Node implements Writable { |
| 40 | private final String name; |
| 41 | private final Map attributes; |
| 42 | private final Map attributeNamespaces; |
| 43 | private final String namespaceURI; |
| 44 | private final List children = new LinkedList(); |
| 45 | private final Stack replacementNodeStack = new Stack(); |
| 46 | private final Node parent; |
| 47 | |
| 48 | /** |
| 49 | * @param parent the parent node |
| 50 | * @param name the name for the node |
| 51 | * @param attributes the attributes for the node |
| 52 | * @param attributeNamespaces the namespace mappings for attributes |
| 53 | * @param namespaceURI the namespace URI if any |
| 54 | */ |
| 55 | public Node(final Node parent, final String name, final Map attributes, final Map attributeNamespaces, final String namespaceURI) { |
| 56 | this.name = name; |
| 57 | this.attributes = attributes; |
| 58 | this.attributeNamespaces = attributeNamespaces; |
| 59 | this.namespaceURI = namespaceURI; |
| 60 | this.parent = parent; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Returns the name of this Node. |
| 65 | * @return the name of this Node |
| 66 | */ |
| 67 | public String name() { |
| 68 | return this.name; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Returns the parent of this Node. |
| 73 | * @return the parent of this Node |
| 74 | */ |
| 75 | public Node parent() { |
| 76 | return this.parent; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Returns the URI of the namespace of this Node. |
| 81 | * @return the namespace of this Node |
| 82 | */ |
| 83 | public String namespaceURI() { |
| 84 | return this.namespaceURI; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Returns a map of the attributes of this Node. |
| 89 | * @return a map of the attributes of this Node |
| 90 | */ |
| 91 | public Map attributes() { |
| 92 | return this.attributes; |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Returns a list of the children of this Node. |
nothing calls this directly
no outgoing calls
no test coverage detected