Beispiel #1
0
 protected void resetChildReaders() {
   if (childPullReaders != null) {
     for (XmlPullReader childTagReader : childPullReaders) {
       childTagReader.reset();
     }
   }
 }
Beispiel #2
0
 protected void addChildPullReaders(XmlPullReader... childTagReaders) {
   if (childPullReaders == null) {
     this.childPullReaders = new ArrayList<XmlPullReader>();
   }
   for (XmlPullReader reader : childTagReaders) {
     childPullReaders.add(reader);
     reader.setParentReader(this);
   }
 }
Beispiel #3
0
 protected XmlPullReader getChildPullReader() throws XmlParseException {
   if (childPullReaders != null) {
     for (int i = lastChildPullReaderIdx; i < childPullReaders.size(); i++) {
       XmlPullReader tagReader = childPullReaders.get(i);
       if (tagReader.isTagSupported(parser.getName(), parser.getNamespace())) {
         if (!unordered) {
           this.lastChildPullReaderIdx = i;
         }
         return tagReader;
       }
     }
   }
   throw new XmlParseException(parser, "unsupported tag");
 }
Beispiel #4
0
 protected void handleChildTag(XmlPullReader childTagReader)
     throws XmlPullParserException, IOException, XmlParseException {
   // When recursing, store state and reset the 0
   int tmpLastChildPullReaderIdx = lastChildPullReaderIdx;
   int tmpCount = count;
   this.lastChildPullReaderIdx = 0;
   this.count = 0;
   // Recurse child node
   childTagReader.parseElement(parser);
   // Restore state from before iteration
   this.lastChildPullReaderIdx = tmpLastChildPullReaderIdx;
   this.count = tmpCount;
 }