示例#1
0
 public static ExtensionElement parseExtensionElement(
     String str, String str2, XmlPullParser xmlPullParser)
     throws XmlPullParserException, IOException, SmackException {
   ParserUtils.assertAtStartTag(xmlPullParser);
   ExtensionElementProvider extensionProvider = ProviderManager.getExtensionProvider(str, str2);
   if (extensionProvider == null) {
     int depth = xmlPullParser.getDepth();
     ExtensionElement defaultExtensionElement = new DefaultExtensionElement(str, str2);
     while (true) {
       switch (xmlPullParser.next()) {
         case VideoSize.HVGA /*2*/:
           String name = xmlPullParser.getName();
           if (!xmlPullParser.isEmptyElementTag()) {
             if (xmlPullParser.next() != 4) {
               break;
             }
             defaultExtensionElement.setValue(name, xmlPullParser.getText());
             break;
           }
           defaultExtensionElement.setValue(name, "");
           break;
         case Version.API03_CUPCAKE_15 /*3*/:
           if (xmlPullParser.getDepth() != depth) {
             break;
           }
           return defaultExtensionElement;
         default:
           break;
       }
     }
   }
   return (ExtensionElement) extensionProvider.parse(xmlPullParser);
 }
示例#2
0
 public XmlStringBuilder prelude(ExtensionElement pe) {
   return prelude(pe.getElementName(), pe.getNamespace());
 }
示例#3
0
 /**
  * Creates a new stanza(/packet) extension filter for the given stanza(/packet) extension.
  *
  * @param packetExtension
  */
 public PacketExtensionFilter(ExtensionElement packetExtension) {
   this(packetExtension.getElementName(), packetExtension.getNamespace());
 }