/** * This method is used to determine if the node is the root * node for the XML document. The root node is the first node * in the document and has no sibling nodes. This is false * if the node has a parent node or a sibling node. * * @param node this is the node that is check as the root * * @return true if the node is the root node for the document */ public boolean isRoot(OutputNode node) { return stack.bottom() == node; }
/** * This method is used to determine if the node is the root * node for the XML document. The root node is the first node * in the document and has no sibling nodes. This is false * if the node has a parent node or a sibling node. * * @param node this is the node that is check as the root * * @return true if the node is the root node for the document */ public boolean isRoot(OutputNode node) { return stack.bottom() == node; }
/** * This method is used to determine if the node is the root * node for the XML document. The root node is the first node * in the document and has no sibling nodes. This is false * if the node has a parent node or a sibling node. * * @param node this is the node that is check as the root * * @return true if the node is the root node for the document */ public boolean isRoot(OutputNode node) { return stack.bottom() == node; }
/** * This is used to remove any uncommitted changes. Removal of an * output node can only be done if it has no siblings and has * not yet been committed. If the node is committed then this * will throw an exception to indicate that it cannot be removed. * * @throws Exception thrown if the node cannot be removed */ public void remove() throws Exception { if(stack.isEmpty()) { throw new NodeException("No root node"); } stack.bottom().remove(); }
/** * This is used to remove any uncommitted changes. Removal of an * output node can only be done if it has no siblings and has * not yet been committed. If the node is committed then this * will throw an exception to indicate that it cannot be removed. * * @throws Exception thrown if the node cannot be removed */ public void remove() throws Exception { if(stack.isEmpty()) { throw new NodeException("No root node"); } stack.bottom().remove(); }
/** * This will commit this element and any uncommitted elements * elements that are decendents of this node. For instance if * any child or grand child remains open under this element * then those elements will be closed before this is closed. * * @throws Exception this is thrown if there is an I/O error * or if a root element has not yet been created */ public void commit() throws Exception { if(stack.isEmpty()) { throw new NodeException("No root node"); } stack.bottom().commit(); }
/** * This will commit this element and any uncommitted elements * elements that are decendents of this node. For instance if * any child or grand child remains open under this element * then those elements will be closed before this is closed. * * @throws Exception this is thrown if there is an I/O error * or if a root element has not yet been created */ public void commit() throws Exception { if(stack.isEmpty()) { throw new NodeException("No root node"); } stack.bottom().commit(); }
/** * This is used to remove any uncommitted changes. Removal of an * output node can only be done if it has no siblings and has * not yet been committed. If the node is committed then this * will throw an exception to indicate that it cannot be removed. * * @throws Exception thrown if the node cannot be removed */ public void remove() throws Exception { if(stack.isEmpty()) { throw new NodeException("No root node"); } stack.bottom().remove(); }
/** * This will commit this element and any uncommitted elements * elements that are decendents of this node. For instance if * any child or grand child remains open under this element * then those elements will be closed before this is closed. * * @throws Exception this is thrown if there is an I/O error * or if a root element has not yet been created */ public void commit() throws Exception { if(stack.isEmpty()) { throw new NodeException("No root node"); } stack.bottom().commit(); }