jaxp/src/share/classes/javax/xml/stream/XMLStreamWriter.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.namespace.NamespaceContext;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * The XMLStreamWriter interface specifies how to write XML.  The XMLStreamWriter  does
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * not perform well formedness checking on its input.  However
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * the writeCharacters method is required to escape & , < and >
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * For attribute values the writeAttribute method will escape the
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * above characters plus " to ensure that all character content
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * and attribute values are well formed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * Each NAMESPACE
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * and ATTRIBUTE must be individually written.
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * <table border="1" cellpadding="2" cellspacing="0">
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *     <thead>
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 *         <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 *             <th colspan="5">XML Namespaces, <code>javax.xml.stream.isRepairingNamespaces</code> and write method behaviour</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 *         </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 *         <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 *             <th>Method</th> <!-- method -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 *             <th colspan="2"><code>isRepairingNamespaces</code> == true</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 *             <th colspan="2"><code>isRepairingNamespaces</code> == false</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 *         </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 *         <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 *             <th></th> <!-- method -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 *             <th>namespaceURI bound</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 *             <th>namespaceURI unbound</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 *             <th>namespaceURI bound</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 *             <th>namespaceURI unbound</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 *         </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 *     </thead>
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 *     <tbody>
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 *         <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
 *             <th><code>writeAttribute(namespaceURI, localName, value)</code></th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
 *             <!-- isRepairingNamespaces == true -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 *                 <!-- namespaceURI bound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 *                 prefix:localName="value"&nbsp;<sup>[1]</sup>
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
 *                 <!-- namespaceURI unbound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
 *                 xmlns:{generated}="namespaceURI" {generated}:localName="value"
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
 *             <!-- isRepairingNamespaces == false -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
 *                 <!-- namespaceURI bound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
 *                 prefix:localName="value"&nbsp;<sup>[1]</sup>
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
 *                 <!-- namespaceURI unbound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
 *                 <code>XMLStreamException</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
 *         </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
 *         <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
 *             <th><code>writeAttribute(prefix, namespaceURI, localName, value)</code></th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
 *             <!-- isRepairingNamespaces == true -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
 *                 <!-- namespaceURI bound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
 *                 bound to same prefix:<br />
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
 *                 prefix:localName="value"&nbsp;<sup>[1]</sup><br />
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
 *                 <br />
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
 *                 bound to different prefix:<br />
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
 *                 xmlns:{generated}="namespaceURI" {generated}:localName="value"
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
 *                 <!-- namespaceURI unbound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
 *                 xmlns:prefix="namespaceURI" prefix:localName="value"&nbsp;<sup>[3]</sup>
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
 *             <!-- isRepairingNamespaces == false -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
 *                 <!-- namespaceURI bound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
 *                 bound to same prefix:<br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
 *                 prefix:localName="value"&nbsp;<sup>[1][2]</sup><br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
 *                 <br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
 *                 bound to different prefix:<br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
 *                 <code>XMLStreamException</code><sup>[2]</sup>
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
 *                 <!-- namespaceURI unbound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
 *                 xmlns:prefix="namespaceURI" prefix:localName="value"&nbsp;<sup>[2][5]</sup>
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
 *         </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
 *         <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
 *             <th><code>writeStartElement(namespaceURI, localName)</code><br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
 *                 <br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
 *                 <code>writeEmptyElement(namespaceURI, localName)</code></th>
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
 *             <!-- isRepairingNamespaces == true -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
 *             <td >
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
 *                 <!-- namespaceURI bound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
 *                 &lt;prefix:localName&gt;&nbsp;<sup>[1]</sup>
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
 *                 <!-- namespaceURI unbound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
 *                 &lt;{generated}:localName xmlns:{generated}="namespaceURI"&gt;
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
 *             <!-- isRepairingNamespaces == false -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
 *                 <!-- namespaceURI bound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
 *                 &lt;prefix:localName&gt;&nbsp;<sup>[1]</sup>
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
 *                 <!-- namespaceURI unbound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
 *                 <code>XMLStreamException</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
 *         </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
 *         <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
 *             <th><code>writeStartElement(prefix, localName, namespaceURI)</code><br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
 *                 <br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
 *                 <code>writeEmptyElement(prefix, localName, namespaceURI)</code></th>
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
 *             <!-- isRepairingNamespaces == true -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
 *                 <!-- namespaceURI bound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
 *                 bound to same prefix:<br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
 *                 &lt;prefix:localName&gt;&nbsp;<sup>[1]</sup><br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
 *                 <br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
 *                 bound to different prefix:<br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
 *                 &lt;{generated}:localName xmlns:{generated}="namespaceURI"&gt;
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
 *                 <!-- namespaceURI unbound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
 *                 &lt;prefix:localName xmlns:prefix="namespaceURI"&gt;&nbsp;<sup>[4]</sup>
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
 *             <!-- isRepairingNamespaces == false -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
 *                 <!-- namespaceURI bound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
 *                 bound to same prefix:<br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
 *                 &lt;prefix:localName&gt;&nbsp;<sup>[1]</sup><br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
 *                 <br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
 *                 bound to different prefix:<br />
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
 *                 <code>XMLStreamException</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
 *             <td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
 *                 <!-- namespaceURI unbound -->
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
 *                 &lt;prefix:localName&gt;&nbsp;
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
 *         </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
 *     </tbody>
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
 *     <tfoot>
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
 *         <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
 *             <td colspan="5">
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
 *                 Notes:
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
 *                 <ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
 *                     <li>[1] if namespaceURI == default Namespace URI, then no prefix is written</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
 *                     <li>[2] if prefix == "" || null && namespaceURI == "", then no prefix or Namespace declaration is generated or written</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
 *                     <li>[3] if prefix == "" || null, then a prefix is randomly generated</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
 *                     <li>[4] if prefix == "" || null, then it is treated as the default Namespace and no prefix is generated or written, an xmlns declaration is generated and written if the namespaceURI is unbound</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
 *                     <li>[5] if prefix == "" || null, then it is treated as an invalid attempt to define the default Namespace and an XMLStreamException is thrown</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
 *                 </ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
 *             </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
 *         </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
 *     </tfoot>
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
 * </table>
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
 * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
 * @see XMLOutputFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
 * @see XMLStreamReader
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
 * @since 1.6
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
public interface XMLStreamWriter {
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
   * Writes a start tag to the output.  All writeStartElement methods
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
   * open a new scope in the internal namespace context.  Writing the
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
   * corresponding EndElement causes the scope to be closed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
   * @param localName local name of the tag, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
  public void writeStartElement(String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
   * Writes a start tag to the output
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
   * @param namespaceURI the namespaceURI of the prefix to use, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
   * @param localName local name of the tag, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
   * @throws XMLStreamException if the namespace URI has not been bound to a prefix and
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
   * javax.xml.stream.isRepairingNamespaces has not been set to true
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
  public void writeStartElement(String namespaceURI, String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
   * Writes a start tag to the output
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
   * @param localName local name of the tag, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
   * @param prefix the prefix of the tag, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
   * @param namespaceURI the uri to bind the prefix to, may not be null
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 writeStartElement(String prefix,
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
                                String localName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
                                String namespaceURI)
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
   * Writes an empty element tag to the output
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
   * @param namespaceURI the uri to bind the tag to, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
   * @param localName local name of the tag, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
   * @throws XMLStreamException if the namespace URI has not been bound to a prefix and
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
   * javax.xml.stream.isRepairingNamespaces has not been set to true
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
  public void writeEmptyElement(String namespaceURI, String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
   * Writes an empty element tag to the output
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
   * @param prefix the prefix of the tag, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
   * @param localName local name of the tag, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
   * @param namespaceURI the uri to bind the tag to, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
  public void writeEmptyElement(String prefix, String localName, String namespaceURI)
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
   * Writes an empty element tag to the output
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
   * @param localName local name of the tag, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
  public void writeEmptyElement(String localName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
   * Writes string data to the output without checking for well formedness.
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
   * The data is opaque to the XMLStreamWriter, i.e. the characters are written
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
   * blindly to the underlying output.  If the method cannot be supported
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
   * in the currrent writing context the implementation may throw a
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
   * UnsupportedOperationException.  For example note that any
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
   * namespace declarations, end tags, etc. will be ignored and could
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
   * interfere with proper maintanence of the writers internal state.
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
   * @param data the data to write
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
  //  public void writeRaw(String data) throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
   * Writes an end tag to the output relying on the internal
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
   * state of the writer to determine the prefix and local name
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
   * of the event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
  public void writeEndElement()
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
   * Closes any start tags and writes corresponding end tags.
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
  public void writeEndDocument()
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
   * Close this writer and free any resources associated with the
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
   * writer.  This must not close the underlying output stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
  public void close()
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
   * Write any cached data to the underlying output mechanism.
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
  public void flush()
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
   * Writes an attribute to the output stream without
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
   * a prefix.
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
   * @param localName the local name of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
   * @param value the value of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
   * @throws IllegalStateException if the current state does not allow Attribute writing
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
  public void writeAttribute(String localName, String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
   * Writes an attribute to the output stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
   * @param prefix the prefix for this attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
   * @param namespaceURI the uri of the prefix for this attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
   * @param localName the local name of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
   * @param value the value of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
   * @throws IllegalStateException if the current state does not allow Attribute writing
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
   * @throws XMLStreamException if the namespace URI has not been bound to a prefix and
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
   * javax.xml.stream.isRepairingNamespaces has not been set to true
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
  public void writeAttribute(String prefix,
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
                             String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
                             String localName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
                             String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
   * Writes an attribute to the output stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
   * @param namespaceURI the uri of the prefix for this attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
   * @param localName the local name of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
   * @param value the value of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
   * @throws IllegalStateException if the current state does not allow Attribute writing
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
   * @throws XMLStreamException if the namespace URI has not been bound to a prefix and
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
   * javax.xml.stream.isRepairingNamespaces has not been set to true
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
  public void writeAttribute(String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
                             String localName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
                             String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
   * Writes a namespace to the output stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
   * If the prefix argument to this method is the empty string,
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
   * "xmlns", or null this method will delegate to writeDefaultNamespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
   * @param prefix the prefix to bind this namespace to
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
   * @param namespaceURI the uri to bind the prefix to
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
   * @throws IllegalStateException if the current state does not allow Namespace writing
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
  public void writeNamespace(String prefix, String namespaceURI)
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
   * Writes the default namespace to the stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
   * @param namespaceURI the uri to bind the default namespace to
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
   * @throws IllegalStateException if the current state does not allow Namespace writing
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
  public void writeDefaultNamespace(String namespaceURI)
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
   * Writes an xml comment with the data enclosed
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
   * @param data the data contained in the comment, may be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
  public void writeComment(String data)
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
   * Writes a processing instruction
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
   * @param target the target of the processing instruction, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
  public void writeProcessingInstruction(String target)
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
   * Writes a processing instruction
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
   * @param target the target of the processing instruction, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
   * @param data the data contained in the processing instruction, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
  public void writeProcessingInstruction(String target,
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
                                         String data)
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
   * Writes a CData section
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
   * @param data the data contained in the CData Section, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
  public void writeCData(String data)
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
   * Write a DTD section.  This string represents the entire doctypedecl production
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
   * from the XML 1.0 specification.
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
   * @param dtd the DTD to be written
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
  public void writeDTD(String dtd)
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
   * Writes an entity reference
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
   * @param name the name of the entity
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
  public void writeEntityRef(String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
   * Write the XML Declaration. Defaults the XML version to 1.0, and the encoding to utf-8
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
  public void writeStartDocument()
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
   * Write the XML Declaration. Defaults the XML version to 1.0
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
   * @param version version of the xml document
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
  public void writeStartDocument(String version)
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
   * Write the XML Declaration.  Note that the encoding parameter does
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
   * not set the actual encoding of the underlying output.  That must
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
   * be set when the instance of the XMLStreamWriter is created using the
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
   * XMLOutputFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
   * @param encoding encoding of the xml declaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
   * @param version version of the xml document
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
   * @throws XMLStreamException If given encoding does not match encoding
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
   * of the underlying stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
  public void writeStartDocument(String encoding,
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
                                 String version)
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
7f561c08de6b Initial load
duke
parents:
diff changeset
   444
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   445
   * Write text to the output
7f561c08de6b Initial load
duke
parents:
diff changeset
   446
   * @param text the value to write
7f561c08de6b Initial load
duke
parents:
diff changeset
   447
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   448
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   449
  public void writeCharacters(String text)
7f561c08de6b Initial load
duke
parents:
diff changeset
   450
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   451
7f561c08de6b Initial load
duke
parents:
diff changeset
   452
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   453
   * Write text to the output
7f561c08de6b Initial load
duke
parents:
diff changeset
   454
   * @param text the value to write
7f561c08de6b Initial load
duke
parents:
diff changeset
   455
   * @param start the starting position in the array
7f561c08de6b Initial load
duke
parents:
diff changeset
   456
   * @param len the number of characters to write
7f561c08de6b Initial load
duke
parents:
diff changeset
   457
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   458
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   459
  public void writeCharacters(char[] text, int start, int len)
7f561c08de6b Initial load
duke
parents:
diff changeset
   460
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   461
7f561c08de6b Initial load
duke
parents:
diff changeset
   462
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   463
   * Gets the prefix the uri is bound to
7f561c08de6b Initial load
duke
parents:
diff changeset
   464
   * @return the prefix or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   465
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   466
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   467
  public String getPrefix(String uri)
7f561c08de6b Initial load
duke
parents:
diff changeset
   468
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   469
7f561c08de6b Initial load
duke
parents:
diff changeset
   470
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   471
   * Sets the prefix the uri is bound to.  This prefix is bound
7f561c08de6b Initial load
duke
parents:
diff changeset
   472
   * in the scope of the current START_ELEMENT / END_ELEMENT pair.
7f561c08de6b Initial load
duke
parents:
diff changeset
   473
   * If this method is called before a START_ELEMENT has been written
7f561c08de6b Initial load
duke
parents:
diff changeset
   474
   * the prefix is bound in the root scope.
7f561c08de6b Initial load
duke
parents:
diff changeset
   475
   * @param prefix the prefix to bind to the uri, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   476
   * @param uri the uri to bind to the prefix, may be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   477
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   478
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   479
  public void setPrefix(String prefix, String uri)
7f561c08de6b Initial load
duke
parents:
diff changeset
   480
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   481
7f561c08de6b Initial load
duke
parents:
diff changeset
   482
7f561c08de6b Initial load
duke
parents:
diff changeset
   483
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   484
   * Binds a URI to the default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   485
   * This URI is bound
7f561c08de6b Initial load
duke
parents:
diff changeset
   486
   * in the scope of the current START_ELEMENT / END_ELEMENT pair.
7f561c08de6b Initial load
duke
parents:
diff changeset
   487
   * If this method is called before a START_ELEMENT has been written
7f561c08de6b Initial load
duke
parents:
diff changeset
   488
   * the uri is bound in the root scope.
7f561c08de6b Initial load
duke
parents:
diff changeset
   489
   * @param uri the uri to bind to the default namespace, may be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   490
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   491
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   492
  public void setDefaultNamespace(String uri)
7f561c08de6b Initial load
duke
parents:
diff changeset
   493
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   494
7f561c08de6b Initial load
duke
parents:
diff changeset
   495
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   496
   * Sets the current namespace context for prefix and uri bindings.
7f561c08de6b Initial load
duke
parents:
diff changeset
   497
   * This context becomes the root namespace context for writing and
7f561c08de6b Initial load
duke
parents:
diff changeset
   498
   * will replace the current root namespace context.  Subsequent calls
7f561c08de6b Initial load
duke
parents:
diff changeset
   499
   * to setPrefix and setDefaultNamespace will bind namespaces using
7f561c08de6b Initial load
duke
parents:
diff changeset
   500
   * the context passed to the method as the root context for resolving
7f561c08de6b Initial load
duke
parents:
diff changeset
   501
   * namespaces.  This method may only be called once at the start of
7f561c08de6b Initial load
duke
parents:
diff changeset
   502
   * the document.  It does not cause the namespaces to be declared.
7f561c08de6b Initial load
duke
parents:
diff changeset
   503
   * If a namespace URI to prefix mapping is found in the namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   504
   * context it is treated as declared and the prefix may be used
7f561c08de6b Initial load
duke
parents:
diff changeset
   505
   * by the StreamWriter.
7f561c08de6b Initial load
duke
parents:
diff changeset
   506
   * @param context the namespace context to use for this writer, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   507
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   508
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   509
  public void setNamespaceContext(NamespaceContext context)
7f561c08de6b Initial load
duke
parents:
diff changeset
   510
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   511
7f561c08de6b Initial load
duke
parents:
diff changeset
   512
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   513
   * Returns the current namespace context.
7f561c08de6b Initial load
duke
parents:
diff changeset
   514
   * @return the current NamespaceContext
7f561c08de6b Initial load
duke
parents:
diff changeset
   515
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   516
  public NamespaceContext getNamespaceContext();
7f561c08de6b Initial load
duke
parents:
diff changeset
   517
7f561c08de6b Initial load
duke
parents:
diff changeset
   518
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   519
   * Get the value of a feature/property from the underlying implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
   520
   * @param name The name of the property, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   521
   * @return The value of the property
7f561c08de6b Initial load
duke
parents:
diff changeset
   522
   * @throws IllegalArgumentException if the property is not supported
7f561c08de6b Initial load
duke
parents:
diff changeset
   523
   * @throws NullPointerException if the name is null
7f561c08de6b Initial load
duke
parents:
diff changeset
   524
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   525
  public Object getProperty(java.lang.String name) throws IllegalArgumentException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   526
7f561c08de6b Initial load
duke
parents:
diff changeset
   527
}