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.util; 021 022 import javax.xml.stream.XMLEventReader; 023 import javax.xml.stream.XMLStreamException; 024 import javax.xml.stream.events.XMLEvent; 025 026 public class EventReaderDelegate implements XMLEventReader { 027 private XMLEventReader reader; 028 029 public EventReaderDelegate() { 030 } 031 032 public EventReaderDelegate(XMLEventReader reader) { 033 this.reader = reader; 034 } 035 036 public void close() throws XMLStreamException { 037 reader.close(); 038 } 039 040 public String getElementText() throws XMLStreamException { 041 return reader.getElementText(); 042 } 043 044 public XMLEventReader getParent() { 045 return reader; 046 } 047 048 public Object getProperty(java.lang.String name) 049 throws IllegalArgumentException { 050 return reader.getProperty(name); 051 } 052 053 public boolean hasNext() { 054 return reader.hasNext(); 055 } 056 057 public Object next() { 058 return reader.next(); 059 } 060 061 public XMLEvent nextEvent() throws XMLStreamException { 062 return reader.nextEvent(); 063 } 064 065 public XMLEvent nextTag() throws XMLStreamException { 066 return reader.nextTag(); 067 } 068 069 public XMLEvent peek() throws XMLStreamException { 070 return reader.peek(); 071 } 072 073 public void remove() { 074 reader.remove(); 075 } 076 077 public void setParent(XMLEventReader reader) { 078 this.reader = reader; 079 } 080 }