286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 286N/A * This code is free software; you can redistribute it and/or modify it 286N/A * under the terms of the GNU General Public License version 2 only, as 286N/A * published by the Free Software Foundation. Oracle designates this 286N/A * particular file as subject to the "Classpath" exception as provided 286N/A * by Oracle in the LICENSE file that accompanied this code. 286N/A * This code is distributed in the hope that it will be useful, but WITHOUT 286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 286N/A * version 2 for more details (a copy is included in the LICENSE file that 286N/A * accompanied this code). 286N/A * You should have received a copy of the GNU General Public License version 286N/A * 2 along with this work; if not, write to the Free Software Foundation, 286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 286N/A * or visit www.oracle.com if you need additional information or have any 286N/A * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. 286N/A * Defines an abstract implementation of a factory for getting streams. 286N/A * The following table defines the standard properties of this specification. 286N/A * Each property varies in the level of support required by each implementation. 286N/A * The level of support required is described in the 'Required' column. 286N/A * <table border="2" rules="all" cellpadding="4"> 286N/A * <th align="center" colspan="5"> 286N/A * Configuration parameters 286N/A * <th>Property Name</th> 286N/A * <th>Default Value</th> 286N/A * <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> 286N/A * <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> 286N/A * <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> 286N/A * <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> 286N/A *<tr><td>javax.xml.stream.isSupportingExternalEntities</td><td>Resolve external parsed entities</td><td>Boolean</td><td>Unspecified</td><td>Yes</td></tr> 286N/A *<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> 286N/A * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. 286N/A * @see XMLOutputFactory 286N/A * The property used to turn on/off namespace support, 286N/A * this is to support XML 1.0 documents, 286N/A * only the true setting must be supported 286N/A * The property used to turn on/off implementation specific validation 286N/A * The property that requires the parser to coalesce adjacent character data sections 286N/A * Requires the parser to replace internal 286N/A * entity references with their replacement 286N/A * text and report them as characters 286N/A * The property that requires the parser to resolve external parsed entities 286N/A * The property that requires the parser to support DTDs 286N/A * set/get the implementation of the XMLReporter interface 286N/A * The property used to set/get the implementation of the XMLResolver 286N/A * The property used to set/get the implementation of the allocator 286N/A * Create a new instance of the factory. 286N/A * @throws FactoryConfigurationError if an instance of this factory cannot be loaded 286N/A * Create a new instance of the factory. 286N/A * This static method creates a new factory instance. 286N/A * This method uses the following ordered lookup procedure to determine 286N/A * the XMLInputFactory implementation class to load: 286N/A * and contains the fully qualified name of the implementation class 286N/A * with the key being the system property defined above. 286N/A * Use the Services API (as detailed in the JAR specification), if available, 286N/A * to determine the classname. The Services API will look for a classname 286N/A * available to the runtime. 286N/A * Platform default XMLInputFactory instance. 286N/A * Once an application has obtained a reference to a XMLInputFactory it 286N/A * can use the factory to configure and obtain stream instances. 286N/A * Note that this is a new method that replaces the deprecated newInstance() method. 286N/A * No changes in behavior are defined by this replacement method relative to 286N/A * the deprecated method. 286N/A * @throws FactoryConfigurationError if an instance of this factory cannot be loaded 286N/A * Create a new instance of the factory 286N/A * @param factoryId Name of the factory to find, same as 286N/A * @param classLoader classLoader to use 286N/A * @return the factory implementation 286N/A * @throws FactoryConfigurationError if an instance of this factory cannot be loaded 286N/A * @deprecated This method has been deprecated to maintain API consistency. 286N/A * All newInstance methods have been replaced with corresponding 286N/A * newFactory methods. The replacement {@link 286N/A * #newFactory(java.lang.String, java.lang.ClassLoader)} method 286N/A * defines no changes in behavior. 286N/A //do not fallback if given classloader can't find the class, throw exception 286N/A * Create a new instance of the factory. 286N/A * If the classLoader argument is null, then the ContextClassLoader is used. 286N/A * Note that this is a new method that replaces the deprecated 286N/A * newInstance(String factoryId, ClassLoader classLoader) method. 286N/A * No changes in behavior are defined by this replacement method relative 286N/A * to the deprecated method. 286N/A * @param factoryId Name of the factory to find, same as 286N/A * @param classLoader classLoader to use 286N/A * @return the factory implementation 286N/A * @throws FactoryConfigurationError if an instance of this factory cannot be loaded 286N/A //do not fallback if given classloader can't find the class, throw exception 286N/A * Create a new XMLStreamReader from a reader 286N/A * @param reader the XML data to read from 286N/A * @throws XMLStreamException 286N/A * Create a new XMLStreamReader from a JAXP source. This method is optional. 286N/A * @param source the source to read from 286N/A * @throws UnsupportedOperationException if this method is not 286N/A * supported by this XMLInputFactory 286N/A * @throws XMLStreamException 286N/A * Create a new XMLStreamReader from a java.io.InputStream 286N/A * @param stream the InputStream to read from 286N/A * @throws XMLStreamException 286N/A * Create a new XMLStreamReader from a java.io.InputStream 286N/A * @param stream the InputStream to read from 286N/A * @param encoding the character encoding of the stream 286N/A * @throws XMLStreamException 286N/A * Create a new XMLStreamReader from a java.io.InputStream 286N/A * @param systemId the system ID of the stream 286N/A * @param stream the InputStream to read from 286N/A * Create a new XMLStreamReader from a java.io.InputStream 286N/A * @param systemId the system ID of the stream 286N/A * @param reader the InputStream to read from 286N/A * Create a new XMLEventReader from a reader 286N/A * @param reader the XML data to read from 286N/A * @throws XMLStreamException 286N/A * Create a new XMLEventReader from a reader 286N/A * @param systemId the system ID of the input 286N/A * @param reader the XML data to read from 286N/A * @throws XMLStreamException 286N/A * Create a new XMLEventReader from an XMLStreamReader. After being used 286N/A * to construct the XMLEventReader instance returned from this method 286N/A * the XMLStreamReader must not be used. 286N/A * @param reader the XMLStreamReader to read from (may not be modified) 286N/A * @return a new XMLEventReader 286N/A * @throws XMLStreamException 286N/A * Create a new XMLEventReader from a JAXP source. 286N/A * Support of this method is optional. 286N/A * @param source the source to read from 286N/A * @throws UnsupportedOperationException if this method is not 286N/A * supported by this XMLInputFactory 286N/A * Create a new XMLEventReader from a java.io.InputStream 286N/A * @param stream the InputStream to read from 286N/A * @throws XMLStreamException 286N/A * Create a new XMLEventReader from a java.io.InputStream 286N/A * @param stream the InputStream to read from 286N/A * @param encoding the character encoding of the stream 286N/A * @throws XMLStreamException 286N/A * Create a new XMLEventReader from a java.io.InputStream 286N/A * @param systemId the system ID of the stream 286N/A * @param stream the InputStream to read from 286N/A * @throws XMLStreamException 286N/A * Create a filtered reader that wraps the filter around the reader 286N/A * @param reader the reader to filter 286N/A * @param filter the filter to apply to the reader 286N/A * @throws XMLStreamException 286N/A * Create a filtered event reader that wraps the filter around the event reader 286N/A * @param reader the event reader to wrap 286N/A * @param filter the filter to apply to the event reader 286N/A * @throws XMLStreamException 286N/A * The resolver that will be set on any XMLStreamReader or XMLEventReader created 286N/A * by this factory instance. 286N/A * The resolver that will be set on any XMLStreamReader or XMLEventReader created 286N/A * by this factory instance. 286N/A * @param resolver the resolver to use to resolve references 286N/A * The reporter that will be set on any XMLStreamReader or XMLEventReader created 286N/A * by this factory instance. 286N/A * The reporter that will be set on any XMLStreamReader or XMLEventReader created 286N/A * by this factory instance. 286N/A * @param reporter the resolver to use to report non fatal errors 559N/A * implementation. The underlying implementation is not required to support 559N/A * every setting of every property in the specification and may use 559N/A * IllegalArgumentException to signal that an unsupported property may not be 559N/A * set with the specified value. 559N/A * All implementations that implement JAXP 1.5 or newer are required to 559N/A * Access to external DTDs, external Entity References is restricted to the 559N/A * protocols specified by the property. If access is denied during parsing 286N/A * @param name The name of the property (may not be null) 286N/A * @param value The value of the property 286N/A * @throws java.lang.IllegalArgumentException if the property is not supported 286N/A * @param name The name of the property (may not be null) 286N/A * @return The value of the property 286N/A * @throws IllegalArgumentException if the property is not supported 286N/A * Query the set of properties that this factory supports. 286N/A * @param name The name of the property (may not be null) 286N/A * @return true if the property is supported and false otherwise 286N/A * Set a user defined event allocator for events 286N/A * @param allocator the user defined allocator 286N/A * Gets the allocator used by streams created with this factory