001 /*
002 **
003 ** Licensed to the Apache Software Foundation (ASF) under one
004 ** or more contributor license agreements. See the NOTICE file
005 ** distributed with this work for additional information
006 ** regarding copyright ownership. The ASF licenses this file
007 ** to you under the Apache License, Version 2.0 (the
008 ** "License"); you may not use this file except in compliance
009 ** with the License. You may obtain a copy of the License at
010 **
011 ** http://www.apache.org/licenses/LICENSE-2.0
012 **
013 ** Unless required by applicable law or agreed to in writing,
014 ** software distributed under the License is distributed on an
015 ** "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 ** KIND, either express or implied. See the License for the
017 ** specific language governing permissions and limitations
018 ** under the License.
019 */
020 package javax.xml.stream;
021
022 import javax.xml.stream.util.XMLEventAllocator;
023
024 public abstract class XMLInputFactory {
025 public static final java.lang.String ALLOCATOR = "javax.xml.stream.allocator";
026 public static final java.lang.String IS_COALESCING = "javax.xml.stream.isCoalescing";
027 public static final java.lang.String IS_NAMESPACE_AWARE = "javax.xml.stream.isNamespaceAware";
028 public static final java.lang.String IS_REPLACING_ENTITY_REFERENCES = "javax.xml.stream.isReplacingEntityReferences";
029 public static final java.lang.String IS_SUPPORTING_EXTERNAL_ENTITIES = "javax.xml.stream.isSupportingExternalEntities";
030 public static final java.lang.String IS_VALIDATING = "javax.xml.stream.isValidating";
031 public static final java.lang.String REPORTER = "javax.xml.stream.reporter";
032 public static final java.lang.String RESOLVER = "javax.xml.stream.resolver";
033 public static final java.lang.String SUPPORT_DTD = "javax.xml.stream.supportDTD";
034
035 protected XMLInputFactory() {
036 }
037
038 public static XMLInputFactory newInstance()
039 throws FactoryConfigurationError {
040 // We'll assume the XMLInputFactory from the RI as a backup.
041 return (XMLInputFactory)FactoryLocator.locate("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
042 }
043
044 public static XMLInputFactory newInstance(java.lang.String factoryId,
045 java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
046 // We'll assume the XMLInputFactory from the RI as a backup.
047 return (XMLInputFactory)FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxInputFactory", classLoader);
048 }
049
050 public abstract XMLStreamReader createXMLStreamReader(java.io.Reader reader)
051 throws XMLStreamException;
052
053 public abstract XMLStreamReader createXMLStreamReader(
054 javax.xml.transform.Source source) throws XMLStreamException;
055
056 public abstract XMLStreamReader createXMLStreamReader(
057 java.io.InputStream stream) throws XMLStreamException;
058
059 public abstract XMLStreamReader createXMLStreamReader(
060 java.io.InputStream stream, java.lang.String encoding)
061 throws XMLStreamException;
062
063 public abstract XMLStreamReader createXMLStreamReader(
064 java.lang.String systemId, java.io.InputStream stream)
065 throws XMLStreamException;
066
067 public abstract XMLStreamReader createXMLStreamReader(
068 java.lang.String systemId, java.io.Reader reader)
069 throws XMLStreamException;
070
071 public abstract XMLEventReader createXMLEventReader(java.io.Reader reader)
072 throws XMLStreamException;
073
074 public abstract XMLEventReader createXMLEventReader(
075 java.lang.String systemId, java.io.Reader reader)
076 throws XMLStreamException;
077
078 public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
079 throws XMLStreamException;
080
081 public abstract XMLEventReader createXMLEventReader(
082 javax.xml.transform.Source source) throws XMLStreamException;
083
084 public abstract XMLEventReader createXMLEventReader(
085 java.io.InputStream stream) throws XMLStreamException;
086
087 public abstract XMLEventReader createXMLEventReader(
088 java.io.InputStream stream, java.lang.String encoding)
089 throws XMLStreamException;
090
091 public abstract XMLEventReader createXMLEventReader(
092 java.lang.String systemId, java.io.InputStream stream)
093 throws XMLStreamException;
094
095 public abstract XMLStreamReader createFilteredReader(
096 XMLStreamReader reader, StreamFilter filter)
097 throws XMLStreamException;
098
099 public abstract XMLEventReader createFilteredReader(XMLEventReader reader,
100 EventFilter filter) throws XMLStreamException;
101
102 public abstract XMLResolver getXMLResolver();
103
104 public abstract void setXMLResolver(XMLResolver resolver);
105
106 public abstract XMLReporter getXMLReporter();
107
108 public abstract void setXMLReporter(XMLReporter reporter);
109
110 public abstract void setProperty(java.lang.String name,
111 java.lang.Object value) throws java.lang.IllegalArgumentException;
112
113 public abstract java.lang.Object getProperty(java.lang.String name)
114 throws java.lang.IllegalArgumentException;
115
116 public abstract boolean isPropertySupported(java.lang.String name);
117
118 public abstract void setEventAllocator(XMLEventAllocator allocator);
119
120 public abstract XMLEventAllocator getEventAllocator();
121 }