/** * This is used to determine whether this node has been committed. * This will return true if no root element has been created or * if the root element for the document has already been commited. * * @return true if the node is committed or has not been created */ public boolean isCommitted() { return stack.isEmpty(); } }
/** * This is used to determine whether this node has been committed. * This will return true if no root element has been created or * if the root element for the document has already been commited. * * @return true if the node is committed or has not been created */ public boolean isCommitted() { return stack.isEmpty(); } }
/** * This is used to determine whether this node has been committed. * This will return true if no root element has been created or * if the root element for the document has already been commited. * * @return true if the node is committed or has not been created */ public boolean isCommitted() { return stack.isEmpty(); } }
/** * This is used to acquire the root output node for the document. * This will create an empty node that can be used to generate * the root document element as a child to the document. * <p> * Depending on whether or not an encoding has been specified * this method will write a prolog to the generated XML document. * Each prolog written uses an XML version of "1.0". * * @return this returns an output element for the document */ public OutputNode writeRoot() throws Exception { OutputDocument root = new OutputDocument(this, stack); if(stack.isEmpty()) { writer.writeProlog(); } return root; }
/** * This is used to acquire the root output node for the document. * This will create an empty node that can be used to generate * the root document element as a child to the document. * <p> * Depending on whether or not an encoding has been specified * this method will write a prolog to the generated XML document. * Each prolog written uses an XML version of "1.0". * * @return this returns an output element for the document */ public OutputNode writeRoot() throws Exception { OutputDocument root = new OutputDocument(this, stack); if(stack.isEmpty()) { writer.writeProlog(); } return root; }
/** * This is used to acquire the root output node for the document. * This will create an empty node that can be used to generate * the root document element as a child to the document. * <p> * Depending on whether or not an encoding has been specified * this method will write a prolog to the generated XML document. * Each prolog written uses an XML version of "1.0". * * @return this returns an output element for the document */ public OutputNode writeRoot() throws Exception { OutputDocument root = new OutputDocument(this, stack); if(stack.isEmpty()) { writer.writeProlog(); } return root; }
/** * 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 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(); }