1 /*--------------------------------------------------------------------------
\r
2 * Copyright 2004 Taro L. Saito
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
15 *--------------------------------------------------------------------------*/
\r
16 //--------------------------------------
\r
20 // Since: 2005/07/24 2:22:02
\r
24 //--------------------------------------
\r
28 package org.xerial.util.xml.pullparser;
\r
30 import java.io.IOException;
\r
31 import java.io.InputStream;
\r
32 import java.io.Reader;
\r
34 import org.xmlpull.v1.XmlPullParser;
\r
35 import org.xmlpull.v1.XmlPullParserException;
\r
38 * XmlPullParser
\82Ì
\82¤
\82¿
\81Aparsing
\82Ì
\8fó
\91Ô
\82ð
\95Ï
\82¦
\82é
\83\81\83\
\83b
\83h
\8cÄ
\82Ñ
\8fo
\82µ
\82ð
\8bÖ
\82¶
\82½
\83N
\83\89\83X
\81B
\r
39 * next()
\93\99\82ð
\8cÄ
\82Ñ
\8fo
\82·
\82Æ
\81AForbiddenOperationException
\82ð
\94
\90¶
\82³
\82¹
\82é
\81B
\r
44 public class ParseContext implements XmlPullParser
\r
46 private XmlPullParser _parser;
\r
51 public ParseContext(XmlPullParser pullParser)
\r
53 _parser = pullParser;
\r
57 * @see org.xmlpull.v1.XmlPullParser#setFeature(java.lang.String, boolean)
\r
59 public void setFeature(String arg0, boolean arg1) throws XmlPullParserException
\r
61 _parser.setFeature(arg0, arg1);
\r
65 * @see org.xmlpull.v1.XmlPullParser#getFeature(java.lang.String)
\r
67 public boolean getFeature(String arg0)
\r
69 return _parser.getFeature(arg0);
\r
73 * @see org.xmlpull.v1.XmlPullParser#setProperty(java.lang.String, java.lang.Object)
\r
75 public void setProperty(String arg0, Object arg1) throws XmlPullParserException
\r
77 throw new ForbiddenOperationException("setProperty");
\r
81 * @see org.xmlpull.v1.XmlPullParser#getProperty(java.lang.String)
\r
83 public Object getProperty(String arg0)
\r
85 return _parser.getProperty(arg0);
\r
89 * @see org.xmlpull.v1.XmlPullParser#setInput(java.io.Reader)
\r
91 public void setInput(Reader arg0) throws XmlPullParserException
\r
93 throw new ForbiddenOperationException("setInput");
\r
97 * @see org.xmlpull.v1.XmlPullParser#setInput(java.io.InputStream, java.lang.String)
\r
99 public void setInput(InputStream arg0, String arg1) throws XmlPullParserException
\r
101 throw new ForbiddenOperationException("setInput");
\r
105 * @see org.xmlpull.v1.XmlPullParser#getInputEncoding()
\r
107 public String getInputEncoding()
\r
109 return _parser.getInputEncoding();
\r
113 * @see org.xmlpull.v1.XmlPullParser#defineEntityReplacementText(java.lang.String, java.lang.String)
\r
115 public void defineEntityReplacementText(String arg0, String arg1) throws XmlPullParserException
\r
117 throw new ForbiddenOperationException("defineEntityReplacementText");
\r
121 * @see org.xmlpull.v1.XmlPullParser#getNamespaceCount(int)
\r
123 public int getNamespaceCount(int arg0) throws XmlPullParserException
\r
125 return _parser.getNamespaceCount(arg0);
\r
129 * @see org.xmlpull.v1.XmlPullParser#getNamespacePrefix(int)
\r
131 public String getNamespacePrefix(int arg0) throws XmlPullParserException
\r
133 return _parser.getNamespacePrefix(arg0);
\r
137 * @see org.xmlpull.v1.XmlPullParser#getNamespaceUri(int)
\r
139 public String getNamespaceUri(int arg0) throws XmlPullParserException
\r
141 return _parser.getNamespaceUri(arg0);
\r
145 * @see org.xmlpull.v1.XmlPullParser#getNamespace(java.lang.String)
\r
147 public String getNamespace(String arg0)
\r
149 return _parser.getNamespace(arg0);
\r
153 * @see org.xmlpull.v1.XmlPullParser#getDepth()
\r
155 public int getDepth()
\r
157 return _parser.getDepth();
\r
161 * @see org.xmlpull.v1.XmlPullParser#getPositionDescription()
\r
163 public String getPositionDescription()
\r
165 return _parser.getPositionDescription();
\r
169 * @see org.xmlpull.v1.XmlPullParser#getLineNumber()
\r
171 public int getLineNumber()
\r
173 return _parser.getLineNumber();
\r
177 * @see org.xmlpull.v1.XmlPullParser#getColumnNumber()
\r
179 public int getColumnNumber()
\r
181 return _parser.getColumnNumber();
\r
185 * @see org.xmlpull.v1.XmlPullParser#isWhitespace()
\r
187 public boolean isWhitespace() throws XmlPullParserException
\r
189 return _parser.isWhitespace();
\r
193 * @see org.xmlpull.v1.XmlPullParser#getText()
\r
195 public String getText()
\r
197 return _parser.getText();
\r
201 * @see org.xmlpull.v1.XmlPullParser#getTextCharacters(int[])
\r
203 public char[] getTextCharacters(int[] arg0)
\r
205 return _parser.getTextCharacters(arg0);
\r
209 * @see org.xmlpull.v1.XmlPullParser#getNamespace()
\r
211 public String getNamespace()
\r
213 return _parser.getNamespace();
\r
217 * @see org.xmlpull.v1.XmlPullParser#getName()
\r
219 public String getName()
\r
221 return _parser.getName();
\r
225 * @see org.xmlpull.v1.XmlPullParser#getPrefix()
\r
227 public String getPrefix()
\r
229 return _parser.getPrefix();
\r
233 * @see org.xmlpull.v1.XmlPullParser#isEmptyElementTag()
\r
235 public boolean isEmptyElementTag() throws XmlPullParserException
\r
237 return _parser.isEmptyElementTag();
\r
241 * @see org.xmlpull.v1.XmlPullParser#getAttributeCount()
\r
243 public int getAttributeCount()
\r
245 return _parser.getAttributeCount();
\r
249 * @see org.xmlpull.v1.XmlPullParser#getAttributeNamespace(int)
\r
251 public String getAttributeNamespace(int arg0)
\r
253 return _parser.getAttributeNamespace(arg0);
\r
257 * @see org.xmlpull.v1.XmlPullParser#getAttributeName(int)
\r
259 public String getAttributeName(int arg0)
\r
261 return _parser.getAttributeName(arg0);
\r
265 * @see org.xmlpull.v1.XmlPullParser#getAttributePrefix(int)
\r
267 public String getAttributePrefix(int arg0)
\r
269 return _parser.getAttributePrefix(arg0);
\r
273 * @see org.xmlpull.v1.XmlPullParser#getAttributeType(int)
\r
275 public String getAttributeType(int arg0)
\r
277 return _parser.getAttributeType(arg0);
\r
281 * @see org.xmlpull.v1.XmlPullParser#isAttributeDefault(int)
\r
283 public boolean isAttributeDefault(int arg0)
\r
285 return _parser.isAttributeDefault(arg0);
\r
289 * @see org.xmlpull.v1.XmlPullParser#getAttributeValue(int)
\r
291 public String getAttributeValue(int arg0)
\r
293 return _parser.getAttributeName(arg0);
\r
297 * @see org.xmlpull.v1.XmlPullParser#getAttributeValue(java.lang.String, java.lang.String)
\r
299 public String getAttributeValue(String arg0, String arg1)
\r
301 return _parser.getAttributeValue(arg0, arg1);
\r
305 * @see org.xmlpull.v1.XmlPullParser#getEventType()
\r
307 public int getEventType() throws XmlPullParserException
\r
309 return _parser.getEventType();
\r
313 * @see org.xmlpull.v1.XmlPullParser#next()
\r
315 public int next() throws XmlPullParserException, IOException
\r
317 throw new ForbiddenOperationException("next");
\r
321 * @see org.xmlpull.v1.XmlPullParser#nextToken()
\r
323 public int nextToken() throws XmlPullParserException, IOException
\r
325 throw new ForbiddenOperationException("nextToken");
\r
329 * @see org.xmlpull.v1.XmlPullParser#require(int, java.lang.String, java.lang.String)
\r
331 public void require(int arg0, String arg1, String arg2) throws XmlPullParserException, IOException
\r
333 _parser.require(arg0, arg1, arg2);
\r
337 * @see org.xmlpull.v1.XmlPullParser#nextText()
\r
339 public String nextText() throws XmlPullParserException, IOException
\r
341 throw new ForbiddenOperationException("nextText");
\r
345 * @see org.xmlpull.v1.XmlPullParser#nextTag()
\r
347 public int nextTag() throws XmlPullParserException, IOException
\r
349 throw new ForbiddenOperationException("nextTag");
\r