jaxp/src/share/classes/javax/xml/stream/XMLEventWriter.java
author ohair
Mon, 14 Apr 2008 14:52:27 -0700
changeset 311 3c14f21bf3f7
parent 6 7f561c08de6b
permissions -rw-r--r--
6484686: The next directory looks like it is no longer part of the build (deploy makefiles) Summary: Getting rid of the _OUTPUTDIR settings. Using BUILD_PARENT_DIRECTORY instead. This solves problems with the "/build/windows-i586*" paths getting mangled on Windows builds (fastdebug builds in particular). Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
 * Copyright (c) 2003 by BEA Systems, Inc. All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
package javax.xml.stream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import javax.xml.stream.events.*;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import javax.xml.stream.util.XMLEventConsumer;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import javax.xml.namespace.NamespaceContext;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * This is the top level interface for writing XML documents.
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * Instances of this interface are not required to validate the
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * form of the XML.
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * @see XMLEventReader
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * @see javax.xml.stream.events.XMLEvent
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 * @see javax.xml.stream.events.Characters
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * @see javax.xml.stream.events.ProcessingInstruction
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * @see javax.xml.stream.events.StartElement
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * @see javax.xml.stream.events.EndElement
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * @since 1.6
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
public interface XMLEventWriter extends XMLEventConsumer {
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
   * Writes any cached events to the underlying output mechanism
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
  public void flush() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
   * Frees any resources associated with this stream
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
  public void close() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
   * Add an event to the output stream
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
   * Adding a START_ELEMENT will open a new namespace scope that
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
   * will be closed when the corresponding END_ELEMENT is written.
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
   * <table border="2" rules="all" cellpadding="4">
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
   *   <thead>
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
   *       <th align="center" colspan="2">
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
   *         Required and optional fields for events added to the writer
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
   *       </th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
   *   </thead>
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
   *   <tbody>
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
   *       <th>Event Type</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
   *       <th>Required Fields</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
   *       <th>Optional Fields</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
   *       <th>Required Behavior</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
   *       <td> START_ELEMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
   *       <td> QName name </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
   *       <td> namespaces , attributes </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
   *       <td> A START_ELEMENT will be written by writing the name,
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
   *       namespaces, and attributes of the event in XML 1.0 valid
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
   *       syntax for START_ELEMENTs.
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
   *       The name is written by looking up the prefix for
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
   *       the namespace uri.  The writer can be configured to
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
   *       respect prefixes of QNames.  If the writer is respecting
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
   *       prefixes it must use the prefix set on the QName.  The
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
   *       default behavior is to lookup the value for the prefix
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
   *       on the EventWriter's internal namespace context.
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
   *       Each attribute (if any)
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
   *       is written using the behavior specified in the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
   *       section of this table.  Each namespace (if any) is written
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
   *       using the behavior specified in the namespace section of this
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
   *       table.
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
   *       </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
   *       <td> END_ELEMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
   *       <td> Qname name  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
   *       <td> None </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
   *       <td> A well formed END_ELEMENT tag is written.
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
   *       The name is written by looking up the prefix for
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
   *       the namespace uri.  The writer can be configured to
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
   *       respect prefixes of QNames.  If the writer is respecting
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
   *       prefixes it must use the prefix set on the QName.  The
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
   *       default behavior is to lookup the value for the prefix
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
   *       on the EventWriter's internal namespace context.
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
   *       If the END_ELEMENT name does not match the START_ELEMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
   *       name an XMLStreamException is thrown.
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
   *       </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
   *       <td> ATTRIBUTE  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
   *       <td> QName name , String value </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
   *       <td> QName type </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
   *       <td> An attribute is written using the same algorithm
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
   *            to find the lexical form as used in START_ELEMENT.
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
   *            The default is to use double quotes to wrap attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
   *            values and to escape any double quotes found in the
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
   *            value.  The type value is ignored.
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
   *       </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
   *       <td> NAMESPACE  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
   *       <td> String prefix, String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
   *            boolean isDefaultNamespaceDeclaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
   *      </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
   *       <td> None  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
   *       <td> A namespace declaration is written.  If the
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
   *            namespace is a default namespace declaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
   *            (isDefault is true) then xmlns="$namespaceURI"
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
   *            is written and the prefix is optional.  If
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
   *            isDefault is false, the prefix must be declared
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
   *            and the writer must prepend xmlns to the prefix
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
   *            and write out a standard prefix declaration.
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
   *      </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
   *       <td> PROCESSING_INSTRUCTION  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
   *       <td>   None</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
   *       <td>   String target, String data</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
   *       <td>   The data does not need to be present and may be
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
   *              null.  Target is required and many not be null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
   *              The writer
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
   *              will write data section
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
   *              directly after the target,
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
   *              enclosed in appropriate XML 1.0 syntax
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
   *      </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
   *       <td> COMMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
   *       <td> None  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
   *       <td> String comment  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
   *       <td> If the comment is present (not null) it is written, otherwise an
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
   *            an empty comment is written
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
   *      </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
   *       <td> START_DOCUMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
   *       <td> None  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
   *       <td> String encoding , boolean standalone, String version  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
   *       <td> A START_DOCUMENT event is not required to be written to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
   *             stream.  If present the attributes are written inside
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
   *             the appropriate XML declaration syntax
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
   *      </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
   *       <td> END_DOCUMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
   *       <td> None </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
   *       <td> None  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
   *       <td> Nothing is written to the output  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
   *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
   *       <td> DTD  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
   *       <td> String DocumentTypeDefinition  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
   *       <td> None  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
   *       <td> The DocumentTypeDefinition is written to the output  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
   *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
   *   </tbody>
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
   * </table>
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
   * @param event the event to be added
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
  public void add(XMLEvent event) throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
   * Adds an entire stream to an output stream,
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
   * calls next() on the inputStream argument until hasNext() returns false
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
   * This should be treated as a convenience method that will
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
   * perform the following loop over all the events in an
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
   * event reader and call add on each event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
   * @param reader the event stream to add to the output
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
  public void add(XMLEventReader reader) throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
   * Gets the prefix the uri is bound to
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
   * @param uri the uri to look up
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
  public String getPrefix(String uri) throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
   * Sets the prefix the uri is bound to.  This prefix is bound
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
   * in the scope of the current START_ELEMENT / END_ELEMENT pair.
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
   * If this method is called before a START_ELEMENT has been written
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
   * the prefix is bound in the root scope.
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
   * @param prefix the prefix to bind to the uri
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
   * @param uri the uri to bind to the prefix
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
  public void setPrefix(String prefix, String uri) throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
   * Binds a URI to the default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
   * This URI is bound
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
   * in the scope of the current START_ELEMENT / END_ELEMENT pair.
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
   * If this method is called before a START_ELEMENT has been written
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
   * the uri is bound in the root scope.
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
   * @param uri the uri to bind to the default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
  public void setDefaultNamespace(String uri) throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
   * Sets the current namespace context for prefix and uri bindings.
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
   * This context becomes the root namespace context for writing and
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
   * will replace the current root namespace context.  Subsequent calls
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
   * to setPrefix and setDefaultNamespace will bind namespaces using
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
   * the context passed to the method as the root context for resolving
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
   * namespaces.
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
   * @param context the namespace context to use for this writer
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
  public void setNamespaceContext(NamespaceContext context)
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
   * Returns the current namespace context.
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
   * @return the current namespace context
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
  public NamespaceContext getNamespaceContext();
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
}