1/* 2 * Copyright (c) 2005, 2012, 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. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26package com.sun.xml.internal.txw2.output; 27 28import javax.xml.stream.XMLStreamWriter; 29import javax.xml.stream.XMLStreamException; 30import javax.xml.namespace.NamespaceContext; 31 32/** 33 * Delegating {@link XMLStreamWriter}. 34 * 35 * @author Kohsuke Kawaguchi 36 */ 37abstract class DelegatingXMLStreamWriter implements XMLStreamWriter { 38 private final XMLStreamWriter writer; 39 40 public DelegatingXMLStreamWriter(XMLStreamWriter writer) { 41 this.writer = writer; 42 } 43 44 public void writeStartElement(String localName) throws XMLStreamException { 45 writer.writeStartElement(localName); 46 } 47 48 public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException { 49 writer.writeStartElement(namespaceURI, localName); 50 } 51 52 public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException { 53 writer.writeStartElement(prefix, localName, namespaceURI); 54 } 55 56 public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException { 57 writer.writeEmptyElement(namespaceURI, localName); 58 } 59 60 public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException { 61 writer.writeEmptyElement(prefix, localName, namespaceURI); 62 } 63 64 public void writeEmptyElement(String localName) throws XMLStreamException { 65 writer.writeEmptyElement(localName); 66 } 67 68 public void writeEndElement() throws XMLStreamException { 69 writer.writeEndElement(); 70 } 71 72 public void writeEndDocument() throws XMLStreamException { 73 writer.writeEndDocument(); 74 } 75 76 public void close() throws XMLStreamException { 77 writer.close(); 78 } 79 80 public void flush() throws XMLStreamException { 81 writer.flush(); 82 } 83 84 public void writeAttribute(String localName, String value) throws XMLStreamException { 85 writer.writeAttribute(localName, value); 86 } 87 88 public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException { 89 writer.writeAttribute(prefix, namespaceURI, localName, value); 90 } 91 92 public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException { 93 writer.writeAttribute(namespaceURI, localName, value); 94 } 95 96 public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException { 97 writer.writeNamespace(prefix, namespaceURI); 98 } 99 100 public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException { 101 writer.writeDefaultNamespace(namespaceURI); 102 } 103 104 public void writeComment(String data) throws XMLStreamException { 105 writer.writeComment(data); 106 } 107 108 public void writeProcessingInstruction(String target) throws XMLStreamException { 109 writer.writeProcessingInstruction(target); 110 } 111 112 public void writeProcessingInstruction(String target, String data) throws XMLStreamException { 113 writer.writeProcessingInstruction(target, data); 114 } 115 116 public void writeCData(String data) throws XMLStreamException { 117 writer.writeCData(data); 118 } 119 120 public void writeDTD(String dtd) throws XMLStreamException { 121 writer.writeDTD(dtd); 122 } 123 124 public void writeEntityRef(String name) throws XMLStreamException { 125 writer.writeEntityRef(name); 126 } 127 128 public void writeStartDocument() throws XMLStreamException { 129 writer.writeStartDocument(); 130 } 131 132 public void writeStartDocument(String version) throws XMLStreamException { 133 writer.writeStartDocument(version); 134 } 135 136 public void writeStartDocument(String encoding, String version) throws XMLStreamException { 137 writer.writeStartDocument(encoding, version); 138 } 139 140 public void writeCharacters(String text) throws XMLStreamException { 141 writer.writeCharacters(text); 142 } 143 144 public void writeCharacters(char[] text, int start, int len) throws XMLStreamException { 145 writer.writeCharacters(text, start, len); 146 } 147 148 public String getPrefix(String uri) throws XMLStreamException { 149 return writer.getPrefix(uri); 150 } 151 152 public void setPrefix(String prefix, String uri) throws XMLStreamException { 153 writer.setPrefix(prefix, uri); 154 } 155 156 public void setDefaultNamespace(String uri) throws XMLStreamException { 157 writer.setDefaultNamespace(uri); 158 } 159 160 public void setNamespaceContext(NamespaceContext context) throws XMLStreamException { 161 writer.setNamespaceContext(context); 162 } 163 164 public NamespaceContext getNamespaceContext() { 165 return writer.getNamespaceContext(); 166 } 167 168 public Object getProperty(String name) throws IllegalArgumentException { 169 return writer.getProperty(name); 170 } 171} 172