当前位置: 首页>>代码示例>>Java>>正文


Java RosterPacket.ItemType方法代码示例

本文整理汇总了Java中org.jivesoftware.smack.packet.RosterPacket.ItemType方法的典型用法代码示例。如果您正苦于以下问题:Java RosterPacket.ItemType方法的具体用法?Java RosterPacket.ItemType怎么用?Java RosterPacket.ItemType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.smack.packet.RosterPacket的用法示例。


在下文中一共展示了RosterPacket.ItemType方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RosterEntry

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Creates a new roster entry.
 *
 * @param user the user.
 * @param name the nickname for the entry.
 * @param type the subscription type.
 * @param status the subscription status (related to subscriptions pending to be approbed).
 * @param connection a connection to the XMPP server.
 */
RosterEntry(String user, String name, RosterPacket.ItemType type,
            RosterPacket.ItemStatus status, Roster roster, Connection connection) {
    this.user = user;
    this.name = name;
    this.type = type;
    this.status = status;
    this.roster = roster;
    this.connection = connection;
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:19,代码来源:RosterEntry.java

示例2: parseRoster

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
private static RosterPacket parseRoster(XmlPullParser parser) throws Exception {
    RosterPacket roster = new RosterPacket();
    boolean done = false;
    RosterPacket.Item item = null;
    while (!done) {
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            if (parser.getName().equals("item")) {
                String jid = parser.getAttributeValue("", "jid");
                String name = parser.getAttributeValue("", "name");
                // Create packet.
                item = new RosterPacket.Item(jid, name);
                // Set status.
                String ask = parser.getAttributeValue("", "ask");
                RosterPacket.ItemStatus status = RosterPacket.ItemStatus.fromString(ask);
                item.setItemStatus(status);
                // Set type.
                String subscription = parser.getAttributeValue("", "subscription");
                RosterPacket.ItemType type = RosterPacket.ItemType.valueOf(subscription != null ? subscription : "none");
                item.setItemType(type);
            }
            if (parser.getName().equals("group") && item!= null) {
                final String groupName = parser.nextText();
                if (groupName != null && groupName.trim().length() > 0) {
                    item.addGroupName(groupName);
                }
            }
        }
        else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("item")) {
                roster.addRosterItem(item);
            }
            if (parser.getName().equals("query")) {
                done = true;
            }
        }
    }
    return roster;
}
 
开发者ID:bejayoharen,项目名称:java-bells,代码行数:40,代码来源:PacketParserUtils.java

示例3: getType

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
public RosterPacket.ItemType getType() {
	return type;
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:4,代码来源:User.java

示例4: setType

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
@SuppressWarnings("static-access")
public void setType(RosterPacket.ItemType type) {
	this.type = type;
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:5,代码来源:User.java

示例5: parseRoster

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
private static RosterPacket parseRoster(XmlPullParser parser) throws Exception {
    RosterPacket roster = new RosterPacket();
    boolean done = false;
    RosterPacket.Item item = null;
    while (!done) {
    	if(parser.getEventType()==XmlPullParser.START_TAG && 
    			parser.getName().equals("query")){
    		String version = parser.getAttributeValue(null, "ver");
    		roster.setVersion(version);
    	}
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            if (parser.getName().equals("item")) {
                String jid = parser.getAttributeValue("", "jid");
                String name = parser.getAttributeValue("", "name");
                // Create packet.
                item = new RosterPacket.Item(jid, name);
                // Set status.
                String ask = parser.getAttributeValue("", "ask");
                RosterPacket.ItemStatus status = RosterPacket.ItemStatus.fromString(ask);
                item.setItemStatus(status);
                // Set type.
                String subscription = parser.getAttributeValue("", "subscription");
                RosterPacket.ItemType type = RosterPacket.ItemType.valueOf(subscription != null ? subscription : "none");
                item.setItemType(type);
            }
            if (parser.getName().equals("group") && item!= null) {
                final String groupName = parser.nextText();
                if (groupName != null && groupName.trim().length() > 0) {
                    item.addGroupName(groupName);
                }
            }
        }
        else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("item")) {
                roster.addRosterItem(item);
            }
            if (parser.getName().equals("query")) {
                done = true;
            }
        }
    }
    return roster;
}
 
开发者ID:samuelhehe,项目名称:androidpn_enhanced_client,代码行数:45,代码来源:PacketParserUtils.java

示例6: RosterEntry

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Creates a new roster entry.
 * 
 * @param user
 *            the user.
 * @param name
 *            the nickname for the entry.
 * @param type
 *            the subscription type.
 * @param status
 *            the subscription status (related to subscriptions pending to
 *            be approbed).
 * @param connection
 *            a connection to the XMPP server.
 */
RosterEntry(String user, String name, RosterPacket.ItemType type,
		RosterPacket.ItemStatus status, Roster roster, Connection connection) {
	this.user = user;
	this.name = name;
	this.type = type;
	this.status = status;
	this.roster = roster;
	this.connection = connection;
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:25,代码来源:RosterEntry.java

示例7: updateState

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Updates the state of the entry with the new values.
 * 
 * @param name
 *            the nickname for the entry.
 * @param type
 *            the subscription type.
 * @param status
 *            the subscription status (related to subscriptions pending to
 *            be approbed).
 */
void updateState(String name, RosterPacket.ItemType type,
		RosterPacket.ItemStatus status) {
	this.name = name;
	this.type = type;
	this.status = status;
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:18,代码来源:RosterEntry.java

示例8: updateState

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Updates the state of the entry with the new values.
 *
 * @param name the nickname for the entry.
 * @param type the subscription type.
 * @param status the subscription status (related to subscriptions pending to be approbed).
 */
void updateState(String name, RosterPacket.ItemType type, RosterPacket.ItemStatus status) {
    this.name = name;
    this.type = type;
    this.status = status;
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:13,代码来源:RosterEntry.java

示例9: getType

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Returns the roster subscription type of the entry. When the type is
 * RosterPacket.ItemType.none or RosterPacket.ItemType.from,
 * refer to {@link RosterEntry getStatus()} to see if a subscription request
 * is pending.
 *
 * @return the type.
 */
public RosterPacket.ItemType getType() {
    return type;
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:12,代码来源:RosterEntry.java

示例10: getType

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Returns the roster subscription type of the entry. When the type is
 * RosterPacket.ItemType.none or RosterPacket.ItemType.from, refer to
 * {@link RosterEntry getStatus()} to see if a subscription request is
 * pending.
 * 
 * @return the type.
 */
public RosterPacket.ItemType getType() {
	return type;
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:12,代码来源:RosterEntry.java

示例11: getType

import org.jivesoftware.smack.packet.RosterPacket; //导入方法依赖的package包/类
/**
 * Returns the roster subscription type of the entry. When the type is
 * RosterPacket.ItemType.none or RosterPacket.ItemType.from,
 * refer to {@link org.jivesoftware.smack.RosterEntry getStatus()} to see if a subscription request
 * is pending.
 *
 * @return the type.
 */
public RosterPacket.ItemType getType() {
    return type;
}
 
开发者ID:msdx,项目名称:AndroidPNClient,代码行数:12,代码来源:RosterEntry.java


注:本文中的org.jivesoftware.smack.packet.RosterPacket.ItemType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。