code: public void setContentHandler(ContentHandler contentHandler) {
          if (contentHandler == null) throw new NullPointerException();
          if (contentHandler != defaultContentHandler
                  && this.contentHandler == defaultContentHandler) {
              defaultContentHandler.close();
          }
      }
docs: Sets the content handler. If the new content handler is different
  from the default, and the default is still in use, it will be
  automatically closed.
  
  @param contentHandler the new value, never <code>null</code>.
  @throws NullPointerException if the value is null.