protected AbstractHttpOverXmpp . Data parseData ( XmlPullParser parser ) throws XmlPullParserException , IOException { NamedElement child = null ; boolean done = false ; AbstractHttpOverXmpp . Data data = null ; /* We are either at start of data or end of req/res */ if ( parser . getEventType ( ) == XmlPullParser . START_TAG ) { while ( ! done ) { int eventType = parser . next ( ) ; if ( eventType == XmlPullParser . START_TAG ) { switch ( parser . getName ( ) ) { case ELEMENT_TEXT : child = parseText ( parser ) ; break ; case ELEMENT_BASE_64 : child = parseBase64 ( parser ) ; break ; case ELEMENT_CHUNKED_BASE_64 : child = parseChunkedBase64 ( parser ) ; break ; case ELEMENT_XML : child = parseXml ( parser ) ; break ; case ELEMENT_IBB : child = parseIbb ( parser ) ; break ; case ELEMENT_SIPUB : // TODO: sipub is allowed by xep-0332, but is not // implemented yet throw new UnsupportedOperationException ( "sipub is not supported yet" ) ; case ELEMENT_JINGLE : // TODO: jingle is allowed by xep-0332, but is not // implemented yet throw new UnsupportedOperationException ( "jingle is not supported yet" ) ; default : // other elements are not allowed throw new IllegalArgumentException ( "unsupported child tag: " + parser . getName ( ) ) ; } } else if ( eventType == XmlPullParser . END_TAG ) { if ( parser . getName ( ) . equals ( ELEMENT_DATA ) ) { done = true ; } } } data = new AbstractHttpOverXmpp . Data ( child ) ; } return data ; }
Parses Data element if any .