1/*
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24package xwp;
25
26import java.io.OutputStream;
27import java.io.Writer;
28
29import javax.xml.stream.XMLEventWriter;
30import javax.xml.stream.XMLOutputFactory;
31import javax.xml.stream.XMLStreamException;
32import javax.xml.stream.XMLStreamWriter;
33import javax.xml.transform.Result;
34
35public class XMLOutputFactoryWrapper extends XMLOutputFactory {
36    private XMLOutputFactory defaultImpl = XMLOutputFactory.newDefaultFactory();
37
38    @Override
39    public XMLStreamWriter createXMLStreamWriter(Writer stream) throws XMLStreamException {
40        return defaultImpl.createXMLStreamWriter(stream);
41    }
42
43    @Override
44    public XMLStreamWriter createXMLStreamWriter(OutputStream stream) throws XMLStreamException {
45        return defaultImpl.createXMLStreamWriter(stream);
46    }
47
48    @Override
49    public XMLStreamWriter createXMLStreamWriter(OutputStream stream, String encoding)
50            throws XMLStreamException {
51        return defaultImpl.createXMLStreamWriter(stream, encoding);
52    }
53
54    @Override
55    public XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException {
56        return defaultImpl.createXMLStreamWriter(result);
57    }
58
59    @Override
60    public XMLEventWriter createXMLEventWriter(Result result) throws XMLStreamException {
61        return defaultImpl.createXMLEventWriter(result);
62    }
63
64    @Override
65    public XMLEventWriter createXMLEventWriter(OutputStream stream) throws XMLStreamException {
66        return defaultImpl.createXMLEventWriter(stream);
67    }
68
69    @Override
70    public XMLEventWriter createXMLEventWriter(OutputStream stream, String encoding)
71            throws XMLStreamException {
72        return defaultImpl.createXMLEventWriter(stream, encoding);
73    }
74
75    @Override
76    public XMLEventWriter createXMLEventWriter(Writer stream) throws XMLStreamException {
77        return defaultImpl.createXMLEventWriter(stream);
78    }
79
80    @Override
81    public void setProperty(String name, Object value) throws IllegalArgumentException {
82        defaultImpl.setProperty(name, value);
83    }
84
85    @Override
86    public Object getProperty(String name) throws IllegalArgumentException {
87        return defaultImpl.getProperty(name);
88    }
89
90    @Override
91    public boolean isPropertySupported(String name) {
92        return defaultImpl.isPropertySupported(name);
93    }
94
95}
96