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    public abstract class XMLOutputFactory {
023            public static final String IS_REPAIRING_NAMESPACES = "javax.xml.stream.isRepairingNamespaces";
024    
025            protected XMLOutputFactory() { }
026    
027            public static XMLOutputFactory newInstance() throws FactoryConfigurationError {
028                    return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory");
029            }
030    
031            /**
032             * Create a new XMLOutputFactory
033             *
034             * @deprecated This method has been deprecated because
035         * it returns an instance of XMLInputFactory, which is of the
036         * wrong class.  Use the new method
037         * newFactory(java.lang.String factoryId,java.lang.ClassLoader classLoader)
038         * instead.
039             */
040            public static XMLInputFactory newInstance(String factoryId,
041                            java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
042                    return (XMLInputFactory) FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxOutputFactory", classLoader);
043    
044            }
045    
046    
047            /**
048             * Create a new XMLOutputFactory
049             *
050             * This is the replacement for the deprecated newInstance() method
051             */
052            public static XMLOutputFactory newFactory()     throws FactoryConfigurationError {
053                    return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory");
054            }
055    
056            /**
057             * Create a new XMLOutputFactory
058             *
059             * This is the replacement for the deprecated newInstance() method
060             */
061            public static XMLOutputFactory newFactory(String factoryId,     ClassLoader classLoader)
062                            throws FactoryConfigurationError {
063                    // essentially the same thing as deprecated newInstance(), but the correct return type.
064                    return (XMLOutputFactory) FactoryLocator.locate(factoryId, "com.ctc.wstx.stax.WstxOutputFactory", classLoader);
065            }
066    
067            public abstract XMLStreamWriter createXMLStreamWriter(java.io.Writer stream)
068                            throws XMLStreamException;
069    
070            public abstract XMLStreamWriter createXMLStreamWriter(
071                            java.io.OutputStream stream) throws XMLStreamException;
072    
073            public abstract XMLStreamWriter createXMLStreamWriter(
074                            java.io.OutputStream stream, String encoding)
075                            throws XMLStreamException;
076    
077            public abstract XMLStreamWriter createXMLStreamWriter(
078                            javax.xml.transform.Result result) throws XMLStreamException;
079    
080            public abstract XMLEventWriter createXMLEventWriter(
081                            javax.xml.transform.Result result) throws XMLStreamException;
082    
083            public abstract XMLEventWriter createXMLEventWriter(
084                            java.io.OutputStream stream) throws XMLStreamException;
085    
086            public abstract XMLEventWriter createXMLEventWriter(
087                            java.io.OutputStream stream, String encoding)
088                            throws XMLStreamException;
089    
090            public abstract XMLEventWriter createXMLEventWriter(java.io.Writer stream)
091                            throws XMLStreamException;
092    
093            public abstract void setProperty(String name, Object value)
094                            throws IllegalArgumentException;
095    
096            public abstract Object getProperty(String name)
097                            throws IllegalArgumentException;
098    
099            public abstract boolean isPropertySupported(String name);
100    }