Closes this document.
<b>NOTICE:</b> It is <b>absolutely necessary</b> to call this method in the end,
as otherwise the last added child node will not be appropriately finished!
552908
public void close() throws IOException {
		// close last tag, if present
		if(lastChildNode!=null) {
			lastChildNode.close();
			lastChildNode = null;
		}
		writer.write("\n");
		writer.flush();
		isOpen = false;
	}
1094369
@Override
    public void end() {
        mTerminated = true;
        if (isStarted()) {
            if (mSortedNodes.size() != mNodes.size()) {
                // hasn't been started yet - sort the nodes now, then end them
                sortNodes();
                for (Node node : mSortedNodes) {
                    if (mSetListener == null) {
                        mSetListener = new AnimatorSetListener(this);
                    }
                    node.animation.addListener(mSetListener);
                }
            }
            if (mDelayAnim != null) {
                mDelayAnim.cancel();
            }
            if (mSortedNodes.size() > 0) {
                for (Node node : mSortedNodes) {
                    node.animation.end();
                }
            }
            if (mListeners != null) {
                ArrayList<AnimatorListener> tmpListeners =
                        (ArrayList<AnimatorListener>) mListeners.clone();
                for (AnimatorListener listener : tmpListeners) {
                    listener.onAnimationEnd(this);
                }
            }
            mStarted = false;
        }
    }
1001701
public void endDocument()
            throws SAXException {
        try {
            out.flush();
            logger.debug("[Freezehandler]: End parsing of pom file");
        } catch (IOException e) {
            throw new SAXException("I/O error", e);
        }
    }
202109
@Override
	public void close() {
		if (this.closed) {
			return;
		}
		this.closed = true;
		if (this.raf != null) {
			/*
			 * everything is written already. just update the header for
			 * record count and the END_OF_DATA mark
			 */
			try {
				this.header.numberOfRecords = this.recordCount;
				this.raf.seek(0);
				this.header.write(this.raf);
				this.raf.seek(this.raf.length());
				this.raf.writeByte(END_OF_DATA);
			}
			catch (IOException e) {
				throw new DBFException(e.getMessage(), e);
			}
			finally {
				DBFUtils.close(this.raf);
			}
		}
		else if (this.outputStream != null) {
			try {
				writeToStream(this.outputStream);
			}
			finally {
				DBFUtils.close(this.outputStream);
			}
		}

	}
361050
public void endDocument() throws org.xml.sax.SAXException
    {
        flushPending();
        if (m_doIndent && !m_isprevtext)
        {
            try
            {
            outputLineSep();
            }
            catch(IOException e)
            {
                throw new SAXException(e);
            }
        }

        flushWriter();
        
        if (m_tracer != null)
            super.fireEndDoc();
    }
752376
@Override public void close() throws IOException {
    sink.close();

    int size = stackSize;
    if (size > 1 || (size == 1 && scopes[size - 1] != NONEMPTY_DOCUMENT)) {
      throw new IOException("Incomplete document");
    }
    stackSize = 0;
  }
91026
protected void endNode(Node node) throws org.xml.sax.SAXException {

        switch (node.getNodeType()) {
            case Node.DOCUMENT_NODE :
                break;
            case Node.DOCUMENT_TYPE_NODE :
                serializeDocType((DocumentType) node, false);
                break;
            case Node.ELEMENT_NODE :
                serializeElement((Element) node, false);
                break;
            case Node.CDATA_SECTION_NODE :
                break;
            case Node.ENTITY_REFERENCE_NODE :
                serializeEntityReference((EntityReference) node, false);
                break;
            default :
                }
    }
1063196
@Override
    public void closeFile() throws JournalException {
        try {
            super.testStateChange(State.FILE_CLOSED);
            parent.writeDocumentTrailer(xmlWriter);
            xmlWriter.close();

            /*
             * SOME implementations of XMLWriter do not close all resources, so
             * we need to close the rmi manually just in case.
             */
            try {
                writer.close();
            } catch (IOException e) {
                throw new JournalException(e);
            }
            super.setState(State.FILE_CLOSED);
        } catch (XMLStreamException e) {
            throw new JournalException(e);
        }
    }
766351
public void close() throws IOException {
    if (kids != null) {
      for (RecordReader<K,? extends Writable> rr : kids) {
        rr.close();
      }
    }
    if (jc != null) {
      jc.close();
    }
  }
909482
@Override public void close() {
    if (parent != null) parent.remove(this);
    setState(State.DISPOSED);
    setBatch(null);
  }
357842
@Override
    public void close() {
        if (!closed.getAndSet(true)) {
            if (fc != null) {
                try {
                    fc.close();
                    fc = null;
                } catch (final IOException e) {
                    // Ignore
                }
            }
            if (raf != null) {
                try {
                    raf.close();
                    raf = null;
                } catch (final IOException e) {
                    // Ignore
                }
            }
            if (chunkIdxToByteBuffer != null) {
                chunkIdxToByteBuffer.clear();
                chunkIdxToByteBuffer = null;
            }
            if (mappedByteBuffersCached != null) {
                for (int i = 0; i < mappedByteBuffersCached.length; i++) {
                    if (mappedByteBuffersCached[i] != null) {
                        FileUtils.closeDirectByteBuffer(mappedByteBuffersCached[i], /* log = */ null);
                        mappedByteBuffersCached[i] = null;
                    }
                }
                mappedByteBuffersCached = null;
            }
            nestedJarHandler = null;
        }
    }
1251485
public void closeElement() throws XMLException, IOException {
		if (!Type.START_ELEMENT.equals(event.type))
			throw new IOException("Invalid call of closeElement: it must be called on a start element");
		if (event.isClosed) return;
		ElementContext ctx = event.context.getFirst();
		do {
			try { next(); }
			catch (EOFException e) {
				throw new XMLException(getPosition(), "Unexpected end", "closeElement(" + ctx.text.asString() + ")");
			}
			if (Type.END_ELEMENT.equals(event.type)) {
				if (event.context.getFirst() == ctx)
					return;
			}
		} while (true);
	}
490401
public void endDocument() throws org.xml.sax.SAXException
  {

    try
    {
      if (null != getStylesheetRoot())
      {
        if (0 == m_stylesheetLevel)
          getStylesheetRoot().recompose();        
      }
      else
        throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!");

      XSLTElementProcessor elemProcessor = getCurrentProcessor();

      if (null != elemProcessor)
        elemProcessor.startNonText(this);

      m_stylesheetLevel--;			
      
      popSpaceHandling();

      // WARNING: This test works only as long as stylesheets are parsed
      // more or less recursively. If we switch to an iterative "work-list"
      // model, this will become true prematurely. In that case,
      // isStylesheetParsingComplete() will have to be adjusted to be aware
      // of the worklist.
      m_parsingComplete = (m_stylesheetLevel < 0);
    }
    catch (TransformerException te)
    {
      throw new org.xml.sax.SAXException(te);
    }
  }
66897
@Override
	public void close() throws IOException {
		if (this.in!=null) {
			in.close();
		}
		if (this.currentWorkbook!=null) {
			LOG.debug("Closing current Workbook \""+this.hocr.getFileName()+"\"");
			this.currentWorkbook.close();
		}
		for (Workbook addedWorkbook: this.addedWorkbooks) {
			
			addedWorkbook.close();
		}
	
	}
439496
public final void close() throws Exception {
        if (content != null) {
            content.clear();
            content = null;
        }
        iterator = null;
    }
1110815
@Override
  public synchronized void close() throws Exception {
    if (this.readerWriter != null && !this.writerClosed) {
      this.readerWriter.close();
      this.writerClosed = true;
    }
  }
720738
@Override
  public void close() {
    status = TrStatus.CLOSED;
    try {
      node.close();
    } catch (IOException e) {
      log.error("Failed to close ephemeral node");
      throw new IllegalStateException(e);
    }
  }