jaxp/src/share/classes/javax/xml/stream/XMLInputFactory.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.transform.Source;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import javax.xml.stream.util.XMLEventAllocator;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * Defines an abstract implementation of a factory for getting streams.
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * The following table defines the standard properties of this specification.
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * Each property varies in the level of support required by each implementation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * The level of support required is described in the 'Required' column.
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 *   <table border="2" rules="all" cellpadding="4">
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 *    <thead>
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 *      <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 *        <th align="center" colspan="5">
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *          Configuration parameters
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 *        </th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 *      </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 *    </thead>
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 *    <tbody>
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 *      <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 *        <th>Property Name</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 *        <th>Behavior</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 *        <th>Return type</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 *        <th>Default Value</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 *        <th>Required</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 *      </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * <tr><td>javax.xml.stream.isValidating</td><td>Turns on/off implementation specific DTD validation</td><td>Boolean</td><td>False</td><td>No</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 * <tr><td>javax.xml.stream.isNamespaceAware</td><td>Turns on/off namespace processing for XML 1.0 support</td><td>Boolean</td><td>True</td><td>True (required) / False (optional)</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 * <tr><td>javax.xml.stream.isCoalescing</td><td>Requires the processor to coalesce adjacent character data</td><td>Boolean</td><td>False</td><td>Yes</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 * <tr><td>javax.xml.stream.isReplacingEntityReferences</td><td>replace internal entity references with their replacement text and report them as characters</td><td>Boolean</td><td>True</td><td>Yes</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 *<tr><td>javax.xml.stream.isSupportingExternalEntities</td><td>Resolve external parsed entities</td><td>Boolean</td><td>Unspecified</td><td>Yes</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 *<tr><td>javax.xml.stream.supportDTD</td><td>Use this property to request processors that do not support DTDs</td><td>Boolean</td><td>True</td><td>Yes</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 *<tr><td>javax.xml.stream.reporter</td><td>sets/gets the impl of the XMLReporter </td><td>javax.xml.stream.XMLReporter</td><td>Null</td><td>Yes</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 *<tr><td>javax.xml.stream.resolver</td><td>sets/gets the impl of the XMLResolver interface</td><td>javax.xml.stream.XMLResolver</td><td>Null</td><td>Yes</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
 *<tr><td>javax.xml.stream.allocator</td><td>sets/gets the impl of the XMLEventAllocator interface</td><td>javax.xml.stream.util.XMLEventAllocator</td><td>Null</td><td>Yes</td></tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
 *    </tbody>
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 *  </table>
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 * @see XMLOutputFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
 * @see XMLEventReader
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
 * @see XMLStreamReader
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
 * @see EventFilter
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
 * @see XMLReporter
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
 * @see XMLResolver
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
 * @see javax.xml.stream.util.XMLEventAllocator
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
 * @since 1.6
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
public abstract class XMLInputFactory {
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
   * The property used to turn on/off namespace support,
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
   * this is to support XML 1.0 documents,
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
   * only the true setting must be supported
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
  public static final String IS_NAMESPACE_AWARE=
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
    "javax.xml.stream.isNamespaceAware";
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
   * The property used to turn on/off implementation specific validation
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
  public static final String IS_VALIDATING=
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
    "javax.xml.stream.isValidating";
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
   * The property that requires the parser to coalesce adjacent character data sections
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
  public static final String IS_COALESCING=
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
    "javax.xml.stream.isCoalescing";
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
   * Requires the parser to replace internal
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
   * entity references with their replacement
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
   * text and report them as characters
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
  public static final String IS_REPLACING_ENTITY_REFERENCES=
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
    "javax.xml.stream.isReplacingEntityReferences";
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
   *  The property that requires the parser to resolve external parsed entities
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
  public static final String IS_SUPPORTING_EXTERNAL_ENTITIES=
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
    "javax.xml.stream.isSupportingExternalEntities";
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
   *  The property that requires the parser to support DTDs
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
  public static final String SUPPORT_DTD=
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
    "javax.xml.stream.supportDTD";
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
   * The property used to
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
   * set/get the implementation of the XMLReporter interface
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
  public static final String REPORTER=
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
    "javax.xml.stream.reporter";
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
   * The property used to set/get the implementation of the XMLResolver
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
  public static final String RESOLVER=
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
    "javax.xml.stream.resolver";
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
   * The property used to set/get the implementation of the allocator
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
  public static final String ALLOCATOR=
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
    "javax.xml.stream.allocator";
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
  protected XMLInputFactory(){}
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
   * Create a new instance of the factory.
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
   * This static method creates a new factory instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
   * This method uses the following ordered lookup procedure to determine
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
   * the XMLInputFactory implementation class to load:
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
   * Use the javax.xml.stream.XMLInputFactory system property.
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
   * Use the properties file "lib/stax.properties" in the JRE directory.
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
   * This configuration file is in standard java.util.Properties format and contains
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
   * the fully qualified name of the implementation class with the key being the system property defined above.
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
   * Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
   * The Services API will look for a classname in the file META-INF/services/javax.xml.stream.XMLInputFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
   * in jars available to the runtime.
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
   * Platform default XMLInputFactory instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
   * Once an application has obtained a reference to a XMLInputFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
   * it can use the factory to configure and obtain stream instances.
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
   * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
  public static XMLInputFactory newInstance()
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
    throws FactoryConfigurationError
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
    return (XMLInputFactory) FactoryFinder.find(
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
      "javax.xml.stream.XMLInputFactory",
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
      "com.sun.xml.internal.stream.XMLInputFactoryImpl");
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
   * Create a new instance of the factory
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
   * @param factoryId             Name of the factory to find, same as
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
   *                              a property name
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
   * @param classLoader           classLoader to use
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
   * @return the factory implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
   * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
  public static XMLInputFactory newInstance(String factoryId,
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
          ClassLoader classLoader)
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
          throws FactoryConfigurationError {
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
      try {
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
          //do not fallback if given classloader can't find the class, throw exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
          return (XMLInputFactory) FactoryFinder.newInstance(factoryId, classLoader, false);
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
      } catch (FactoryFinder.ConfigurationError e) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
          throw new FactoryConfigurationError(e.getException(),
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
                  e.getMessage());
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
      }
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
   * Create a new XMLStreamReader from a reader
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
   * @param reader the XML data to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
  public abstract XMLStreamReader createXMLStreamReader(java.io.Reader reader)
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
   * Create a new XMLStreamReader from a JAXP source.  This method is optional.
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
   * @param source the source to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
   * @throws UnsupportedOperationException if this method is not
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
   * supported by this XMLInputFactory
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
  public abstract XMLStreamReader createXMLStreamReader(Source source)
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
   * Create a new XMLStreamReader from a java.io.InputStream
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
   * @param stream the InputStream to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
  public abstract XMLStreamReader createXMLStreamReader(java.io.InputStream stream)
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
   * Create a new XMLStreamReader from a java.io.InputStream
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
   * @param stream the InputStream to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
   * @param encoding the character encoding of the stream
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 abstract XMLStreamReader createXMLStreamReader(java.io.InputStream stream, String encoding)
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
   * Create a new XMLStreamReader from a java.io.InputStream
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
   * @param systemId the system ID of the stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
   * @param stream the InputStream to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
  public abstract XMLStreamReader createXMLStreamReader(String systemId, java.io.InputStream stream)
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
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
   * Create a new XMLStreamReader from a java.io.InputStream
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
   * @param systemId the system ID of the stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
   * @param reader the InputStream to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
  public abstract XMLStreamReader createXMLStreamReader(String systemId, java.io.Reader reader)
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
   * Create a new XMLEventReader from a reader
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
   * @param reader the XML data to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
  public abstract XMLEventReader createXMLEventReader(java.io.Reader reader)
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
   * Create a new XMLEventReader from a reader
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
   * @param systemId the system ID of the input
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
   * @param reader the XML data to read from
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
  public abstract XMLEventReader createXMLEventReader(String systemId, java.io.Reader reader)
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
   * Create a new XMLEventReader from an XMLStreamReader.  After being used
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
   * to construct the XMLEventReader instance returned from this method
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
   * the XMLStreamReader must not be used.
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
   * @param reader the XMLStreamReader to read from (may not be modified)
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
   * @return a new XMLEventReader
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
  public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
   * Create a new XMLEventReader from a JAXP source.
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
   * Support of this method is optional.
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
   * @param source the source to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
   * @throws UnsupportedOperationException if this method is not
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
   * supported by this XMLInputFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
  public abstract XMLEventReader createXMLEventReader(Source source)
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
   * Create a new XMLEventReader from a java.io.InputStream
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
   * @param stream the InputStream to read from
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
  public abstract XMLEventReader createXMLEventReader(java.io.InputStream stream)
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
   * Create a new XMLEventReader from a java.io.InputStream
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
   * @param stream the InputStream to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
   * @param encoding the character encoding of the stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
  public abstract XMLEventReader createXMLEventReader(java.io.InputStream stream, String encoding)
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
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
   * Create a new XMLEventReader from a java.io.InputStream
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
   * @param systemId the system ID of the stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
   * @param stream the InputStream to read from
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
  public abstract XMLEventReader createXMLEventReader(String systemId, java.io.InputStream stream)
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
   * Create a filtered reader that wraps the filter around the reader
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
   * @param reader the reader to filter
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
   * @param filter the filter to apply to the reader
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
  public abstract XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter)
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
   * Create a filtered event reader that wraps the filter around the event reader
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
   * @param reader the event reader to wrap
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
   * @param filter the filter to apply to the event reader
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
  public abstract XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter)
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
    throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
   * The resolver that will be set on any XMLStreamReader or XMLEventReader created
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
   * by this factory instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
  public abstract XMLResolver getXMLResolver();
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
   * The resolver that will be set on any XMLStreamReader or XMLEventReader created
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
   * by this factory instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
   * @param resolver the resolver to use to resolve references
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
  public abstract void  setXMLResolver(XMLResolver resolver);
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
   * The reporter that will be set on any XMLStreamReader or XMLEventReader created
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
   * by this factory instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
  public abstract XMLReporter getXMLReporter();
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
   * The reporter that will be set on any XMLStreamReader or XMLEventReader created
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
   * by this factory instance.
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
   * @param reporter the resolver to use to report non fatal errors
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
  public abstract void setXMLReporter(XMLReporter reporter);
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
   * Allows the user to set specific feature/property on the underlying implementation. The underlying implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
   * is not required to support every setting of every property in the specification and may use IllegalArgumentException
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
   * to signal that an unsupported property may not be set with the specified value.
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
   * @param name The name of the property (may not be null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
   * @param value The value of the property
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
   * @throws java.lang.IllegalArgumentException if the property is not supported
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
  public abstract void setProperty(java.lang.String name, Object value)
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
    throws java.lang.IllegalArgumentException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
   * Get the value of a feature/property from the underlying implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
   * @param name The name of the property (may not be null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
   * @return The value of the property
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
   * @throws IllegalArgumentException if the property is not supported
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
  public abstract Object getProperty(java.lang.String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
    throws java.lang.IllegalArgumentException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
   * Query the set of properties that this factory supports.
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
   * @param name The name of the property (may not be null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
   * @return true if the property is supported and false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
  public abstract boolean isPropertySupported(String name);
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
   * Set a user defined event allocator for events
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
   * @param allocator the user defined allocator
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
  public abstract void setEventAllocator(XMLEventAllocator allocator);
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
   * Gets the allocator used by streams created with this factory
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
  public abstract XMLEventAllocator getEventAllocator();
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
}