Skip to main content
summaryrefslogtreecommitdiffstats
blob: 9c88926547b7739f8a18d408e2f3a6a2b4dad62e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*******************************************************************************
 * Copyright (c) 2002-2005 IBM Corporation and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   IBM - Initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.wsi.internal.core.document;

import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

import org.eclipse.wst.wsi.internal.core.WSIException;
import org.w3c.dom.Document;

/**
 * Defines the interface used to write the Conformance XML documents.
 * 
 * @version 1.0.1
 * @author Peter Brittenham (peterbr@us.ibm.com)
 */
public interface DocumentWriter
{
  /**
   * Get the Document object associated with this Conformance document.
   * @return the Document object associated with this Conformance document.
   * @throws UnsupportedOperationException if operation is not supported.
   */
  public Document getDocument() throws UnsupportedOperationException;

  /**
   * Set writer.
   * @param documentLocation the location of the document.
   * @throws IOException if failed or interrupted I/O operations. 
   */
  public void setWriter(String documentLocation) throws IOException;

  /**
   * Write out only a part of a document to the location
   * that was previously set using the setLocation method.
   * @param reader a Reader object.
   * @throws WSIException if there is trouble writing out the document.
   * @throws IllegalStateException if this operation has been invoked 
   *         at an illegal or inappropriate time.
   */
  public void write(Reader reader) throws WSIException, IllegalStateException;

  /**
   * Write out only a part of a document.
   * @param reader a Reader object.
   * @param writer a Writer object.
   * @throws WSIException if there is trouble writing out the document.
   */
  public void write(Reader reader, Writer writer) throws WSIException;

  /**
   * Close writer.
   * @throws WSIException if there is trouble closing the writer.
   * @throws IllegalStateException if this operation has been invoked 
   *         at an illegal or inappropriate time.
   */
  public void close() throws WSIException, IllegalStateException;
}

Back to the top