reads the document and checks if the last event is END_DOCUMENT. If not, an exception is thrown. The end event is consumed. For parsing partial XML structures, consider using Node.parse ().
(XmlPullParser parser)
| 79 | XML structures, consider using Node.parse (). */ |
| 80 | |
| 81 | public void parse(XmlPullParser parser) |
| 82 | throws IOException, XmlPullParserException { |
| 83 | |
| 84 | parser.require(XmlPullParser.START_DOCUMENT, null, null); |
| 85 | parser.nextToken (); |
| 86 | |
| 87 | encoding = parser.getInputEncoding(); |
| 88 | standalone = (Boolean)parser.getProperty ("http://xmlpull.org/v1/doc/properties.html#xmldecl-standalone"); |
| 89 | |
| 90 | super.parse(parser); |
| 91 | |
| 92 | if (parser.getEventType() != XmlPullParser.END_DOCUMENT) |
| 93 | throw new RuntimeException("Document end expected!"); |
| 94 | |
| 95 | } |
| 96 | |
| 97 | public void removeChild(int index) { |
| 98 | if (index == rootIndex) |
no test coverage detected