Java 类org.jivesoftware.smackx.provider.PrivateDataProvider 实例源码

项目:EIM    文件:PrivateDataManager.java   
public IQ parseIQ(XmlPullParser parser) throws Exception {
    PrivateData privateData = null;
    boolean done = false;
    while (!done) {
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            String elementName = parser.getName();
            String namespace = parser.getNamespace();
            // See if any objects are registered to handle this private data type.
            PrivateDataProvider provider = getPrivateDataProvider(elementName, namespace);
            // If there is a registered provider, use it.
            if (provider != null) {
                privateData = provider.parsePrivateData(parser);
            }
            // Otherwise, use a DefaultPrivateData instance to store the private data.
            else {
                DefaultPrivateData data = new DefaultPrivateData(elementName, namespace);
                boolean finished = false;
                while (!finished) {
                    int event = parser.next();
                    if (event == XmlPullParser.START_TAG) {
                        String name = parser.getName();
                        // If an empty element, set the value with the empty string.
                        if (parser.isEmptyElementTag()) {
                            data.setValue(name,"");
                        }
                        // Otherwise, get the the element text.
                        else {
                            event = parser.next();
                            if (event == XmlPullParser.TEXT) {
                                String value = parser.getText();
                                data.setValue(name, value);
                            }
                        }
                    }
                    else if (event == XmlPullParser.END_TAG) {
                        if (parser.getName().equals(elementName)) {
                            finished = true;
                        }
                    }
                }
                privateData = data;
            }
        }
        else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("query")) {
                done = true;
            }
        }
    }
    return new PrivateDataResult(privateData);
}
项目:androidPN-client.    文件:PrivateDataManager.java   
public IQ parseIQ(XmlPullParser parser) throws Exception {
    PrivateData privateData = null;
    boolean done = false;
    while (!done) {
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            String elementName = parser.getName();
            String namespace = parser.getNamespace();
            // See if any objects are registered to handle this private data type.
            PrivateDataProvider provider = getPrivateDataProvider(elementName, namespace);
            // If there is a registered provider, use it.
            if (provider != null) {
                privateData = provider.parsePrivateData(parser);
            }
            // Otherwise, use a DefaultPrivateData instance to store the private data.
            else {
                DefaultPrivateData data = new DefaultPrivateData(elementName, namespace);
                boolean finished = false;
                while (!finished) {
                    int event = parser.next();
                    if (event == XmlPullParser.START_TAG) {
                        String name = parser.getName();
                        // If an empty element, set the value with the empty string.
                        if (parser.isEmptyElementTag()) {
                            data.setValue(name,"");
                        }
                        // Otherwise, get the the element text.
                        else {
                            event = parser.next();
                            if (event == XmlPullParser.TEXT) {
                                String value = parser.getText();
                                data.setValue(name, value);
                            }
                        }
                    }
                    else if (event == XmlPullParser.END_TAG) {
                        if (parser.getName().equals(elementName)) {
                            finished = true;
                        }
                    }
                }
                privateData = data;
            }
        }
        else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("query")) {
                done = true;
            }
        }
    }
    return new PrivateDataResult(privateData);
}
项目:xmppsupport_v2    文件:PrivateDataManager.java   
public IQ parseIQ(XmlPullParser parser) throws Exception {
    PrivateData privateData = null;
    boolean done = false;
    while (!done) {
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            String elementName = parser.getName();
            String namespace = parser.getNamespace();
            // See if any objects are registered to handle this private
            // data type.
            PrivateDataProvider provider = getPrivateDataProvider(
                    elementName, namespace);
            // If there is a registered provider, use it.
            if (provider != null) {
                privateData = provider.parsePrivateData(parser);
            }
            // Otherwise, use a DefaultPrivateData instance to store the
            // private data.
            else {
                DefaultPrivateData data = new DefaultPrivateData(
                        elementName, namespace);
                boolean finished = false;
                while (!finished) {
                    int event = parser.next();
                    if (event == XmlPullParser.START_TAG) {
                        String name = parser.getName();
                        // If an empty element, set the value with the
                        // empty string.
                        if (parser.isEmptyElementTag()) {
                            data.setValue(name, "");
                        }
                        // Otherwise, get the the element text.
                        else {
                            event = parser.next();
                            if (event == XmlPullParser.TEXT) {
                                String value = parser.getText();
                                data.setValue(name, value);
                            }
                        }
                    } else if (event == XmlPullParser.END_TAG) {
                        if (parser.getName().equals(elementName)) {
                            finished = true;
                        }
                    }
                }
                privateData = data;
            }
        } else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("query")) {
                done = true;
            }
        }
    }
    return new PrivateDataResult(privateData);
}
项目:java-bells    文件:PrivateDataManager.java   
public IQ parseIQ(XmlPullParser parser) throws Exception {
    PrivateData privateData = null;
    boolean done = false;
    while (!done) {
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            String elementName = parser.getName();
            String namespace = parser.getNamespace();
            // See if any objects are registered to handle this private data type.
            PrivateDataProvider provider = getPrivateDataProvider(elementName, namespace);
            // If there is a registered provider, use it.
            if (provider != null) {
                privateData = provider.parsePrivateData(parser);
            }
            // Otherwise, use a DefaultPrivateData instance to store the private data.
            else {
                DefaultPrivateData data = new DefaultPrivateData(elementName, namespace);
                boolean finished = false;
                while (!finished) {
                    int event = parser.next();
                    if (event == XmlPullParser.START_TAG) {
                        String name = parser.getName();
                        // If an empty element, set the value with the empty string.
                        if (parser.isEmptyElementTag()) {
                            data.setValue(name,"");
                        }
                        // Otherwise, get the the element text.
                        else {
                            event = parser.next();
                            if (event == XmlPullParser.TEXT) {
                                String value = parser.getText();
                                data.setValue(name, value);
                            }
                        }
                    }
                    else if (event == XmlPullParser.END_TAG) {
                        if (parser.getName().equals(elementName)) {
                            finished = true;
                        }
                    }
                }
                privateData = data;
            }
        }
        else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("query")) {
                done = true;
            }
        }
    }
    return new PrivateDataResult(privateData);
}
项目:telegraph    文件:PrivateDataManager.java   
public IQ parseIQ(XmlPullParser parser) throws Exception {
    PrivateData privateData = null;
    boolean done = false;
    while (!done) {
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            String elementName = parser.getName();
            String namespace = parser.getNamespace();
            // See if any objects are registered to handle this private data type.
            PrivateDataProvider provider = getPrivateDataProvider(elementName, namespace);
            // If there is a registered provider, use it.
            if (provider != null) {
                privateData = provider.parsePrivateData(parser);
            }
            // Otherwise, use a DefaultPrivateData instance to store the private data.
            else {
                DefaultPrivateData data = new DefaultPrivateData(elementName, namespace);
                boolean finished = false;
                while (!finished) {
                    int event = parser.next();
                    if (event == XmlPullParser.START_TAG) {
                        String name = parser.getName();
                        // If an empty element, set the value with the empty string.
                        if (parser.isEmptyElementTag()) {
                            data.setValue(name,"");
                        }
                        // Otherwise, get the the element text.
                        else {
                            event = parser.next();
                            if (event == XmlPullParser.TEXT) {
                                String value = parser.getText();
                                data.setValue(name, value);
                            }
                        }
                    }
                    else if (event == XmlPullParser.END_TAG) {
                        if (parser.getName().equals(elementName)) {
                            finished = true;
                        }
                    }
                }
                privateData = data;
            }
        }
        else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("query")) {
                done = true;
            }
        }
    }
    return new PrivateDataResult(privateData);
}
项目:NewCommunication-Android    文件:PrivateDataManager.java   
public IQ parseIQ(XmlPullParser parser) throws Exception {
    PrivateData privateData = null;
    boolean done = false;
    while (!done) {
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            String elementName = parser.getName();
            String namespace = parser.getNamespace();
            // See if any objects are registered to handle this private data type.
            PrivateDataProvider provider = getPrivateDataProvider(elementName, namespace);
            // If there is a registered provider, use it.
            if (provider != null) {
                privateData = provider.parsePrivateData(parser);
            }
            // Otherwise, use a DefaultPrivateData instance to store the private data.
            else {
                DefaultPrivateData data = new DefaultPrivateData(elementName, namespace);
                boolean finished = false;
                while (!finished) {
                    int event = parser.next();
                    if (event == XmlPullParser.START_TAG) {
                        String name = parser.getName();
                        // If an empty element, set the value with the empty string.
                        if (parser.isEmptyElementTag()) {
                            data.setValue(name,"");
                        }
                        // Otherwise, get the the element text.
                        else {
                            event = parser.next();
                            if (event == XmlPullParser.TEXT) {
                                String value = parser.getText();
                                data.setValue(name, value);
                            }
                        }
                    }
                    else if (event == XmlPullParser.END_TAG) {
                        if (parser.getName().equals(elementName)) {
                            finished = true;
                        }
                    }
                }
                privateData = data;
            }
        }
        else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("query")) {
                done = true;
            }
        }
    }
    return new PrivateDataResult(privateData);
}
项目:EIM    文件:PrivateDataManager.java   
/**
 * Adds a private data provider with the specified element name and name space. The provider
 * will override any providers loaded through the classpath.
 *
 * @param elementName the XML element name.
 * @param namespace the XML namespace.
 * @param provider the private data provider.
 */
public static void addPrivateDataProvider(String elementName, String namespace,
        PrivateDataProvider provider)
{
    String key = getProviderKey(elementName, namespace);
    privateDataProviders.put(key, provider);
}
项目:androidPN-client.    文件:PrivateDataManager.java   
/**
 * Adds a private data provider with the specified element name and name space. The provider
 * will override any providers loaded through the classpath.
 *
 * @param elementName the XML element name.
 * @param namespace the XML namespace.
 * @param provider the private data provider.
 */
public static void addPrivateDataProvider(String elementName, String namespace,
        PrivateDataProvider provider)
{
    String key = getProviderKey(elementName, namespace);
    privateDataProviders.put(key, provider);
}
项目:java-bells    文件:PrivateDataManager.java   
/**
 * Adds a private data provider with the specified element name and name space. The provider
 * will override any providers loaded through the classpath.
 *
 * @param elementName the XML element name.
 * @param namespace the XML namespace.
 * @param provider the private data provider.
 */
public static void addPrivateDataProvider(String elementName, String namespace,
        PrivateDataProvider provider)
{
    String key = getProviderKey(elementName, namespace);
    privateDataProviders.put(key, provider);
}
项目:telegraph    文件:PrivateDataManager.java   
/**
 * Adds a private data provider with the specified element name and name space. The provider
 * will override any providers loaded through the classpath.
 *
 * @param elementName the XML element name.
 * @param namespace the XML namespace.
 * @param provider the private data provider.
 */
public static void addPrivateDataProvider(String elementName, String namespace,
        PrivateDataProvider provider)
{
    String key = getProviderKey(elementName, namespace);
    privateDataProviders.put(key, provider);
}
项目:NewCommunication-Android    文件:PrivateDataManager.java   
/**
 * Adds a private data provider with the specified element name and name space. The provider
 * will override any providers loaded through the classpath.
 *
 * @param elementName the XML element name.
 * @param namespace the XML namespace.
 * @param provider the private data provider.
 */
public static void addPrivateDataProvider(String elementName, String namespace,
        PrivateDataProvider provider)
{
    String key = getProviderKey(elementName, namespace);
    privateDataProviders.put(key, provider);
}
项目:xmppsupport_v2    文件:PrivateDataManager.java   
/**
 * Adds a private data provider with the specified element name and name
 * space. The provider will override any providers loaded through the
 * classpath.
 * 
 * @param elementName
 *            the XML element name.
 * @param namespace
 *            the XML namespace.
 * @param provider
 *            the private data provider.
 */
public static void addPrivateDataProvider(String elementName,
        String namespace, PrivateDataProvider provider) {
    String key = getProviderKey(elementName, namespace);
    privateDataProviders.put(key, provider);
}