Android Open Source - colibri Parser Util






From Project

Back to project page colibri.

License

The source code is released under:

Apache License

If you think the Android project colibri listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package labrom.colibri.xml;
// w  ww  .j  a va2s.c om
import java.io.IOException;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

class ParserUtil {
  
  
  static boolean moveToNextSibling(XmlPullParser parser) throws XmlPullParserException, IOException {
    String currentTag = parser.getName();
    int currentLevel = parser.getDepth();
    do {
      if(parser.getEventType() != XmlPullParser.END_DOCUMENT)
        parser.next();
      else
        return false;
    } while(!(currentLevel == parser.getDepth() && parser.getEventType() == XmlPullParser.END_TAG && currentTag.equals(parser.getName())));
    parser.nextTag(); // Next sibling's start tag or parent's end tag
    return true;
  }
  

  static boolean isStartTag(XmlPullParser parser) throws XmlPullParserException {
    return parser.getEventType() == XmlPullParser.START_TAG;
  }
  
  static boolean isEndTag(XmlPullParser parser) throws XmlPullParserException {
    return parser.getEventType() == XmlPullParser.END_TAG;
  }

  static boolean isStartDocument(XmlPullParser parser) throws XmlPullParserException {
    return parser.getEventType() == XmlPullParser.START_DOCUMENT;
  }
  
  static boolean isEndDocument(XmlPullParser parser) throws XmlPullParserException {
    return parser.getEventType() == XmlPullParser.END_DOCUMENT;
  }

}




Java Source Code List

labrom.colibri.Util.java
labrom.colibri.cache.CacheEntry.java
labrom.colibri.cache.Cache.java
labrom.colibri.cache.Entries.java
labrom.colibri.data.ActiveContentProvider.java
labrom.colibri.data.ActiveRecordList.java
labrom.colibri.data.ActiveRecord.java
labrom.colibri.data.Database.java
labrom.colibri.data.SelectionArgs.java
labrom.colibri.xml.AttributeContext.java
labrom.colibri.xml.CursorDef.java
labrom.colibri.xml.CursorException.java
labrom.colibri.xml.Cursor.java
labrom.colibri.xml.CustomMap.java
labrom.colibri.xml.ElementContext.java
labrom.colibri.xml.FieldSetter.java
labrom.colibri.xml.Item.java
labrom.colibri.xml.NodeContext.java
labrom.colibri.xml.ObjectFactory.java
labrom.colibri.xml.ParserFactory.java
labrom.colibri.xml.ParserUtil.java
labrom.colibri.xml.PullTest.java
labrom.colibri.xml.ReflectorTest.java
labrom.colibri.xml.Reflector.java
labrom.colibri.xml.RootContext.java
labrom.colibri.xml.SetterTest.java
labrom.colibri.xml.StringToDateTransformer.java
labrom.colibri.xml.StringTransformer.java
labrom.colibri.xml.maps.Cursor4Maps.java
labrom.colibri.xml.maps.CursorDef4Maps.java
labrom.colibri.xml.maps.ElementContext4Maps.java
labrom.colibri.xml.maps.RootContext4Maps.java
labrom.colibri.xml.maps.package-info.java
labrom.colibri.xml.package-info.java