當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils.parseResource方法代碼示例

本文整理匯總了Java中org.jivesoftware.smack.util.StringUtils.parseResource方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.parseResource方法的具體用法?Java StringUtils.parseResource怎麽用?Java StringUtils.parseResource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jivesoftware.smack.util.StringUtils的用法示例。


在下文中一共展示了StringUtils.parseResource方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: xmppAddressToJid

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public static String xmppAddressToJid(String participant) {

    final String address = StringUtils.parseServer(participant);
    final String[] parts = address.split("\\."); //$NON-NLS-1$
    final String server = parts[parts.length-1];
    final String nick = StringUtils.parseResource(participant);

    return nick+"@"+server+JabberClient.JID_RESOURCE; //$NON-NLS-1$
  }
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:10,代碼來源:JabberPlayer.java

示例2: findUsersInMultiUserChat

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
/**
 * 查詢聊天室所有成員的用戶名
 * @param multiUserChat
 * @return
 */
public  static List<String> findUsersInMultiUserChat( MultiUserChat multiUserChat){
    List<String> listUser = new ArrayList<String>();
    Iterator<String> it = multiUserChat.getOccupants();
    // 遍曆出聊天室人員名稱
    while (it.hasNext()) {
        // 聊天室成員名字
        String name = StringUtils.parseResource(it.next());
        listUser.add(name);
    }
    return listUser;
}
 
開發者ID:FanHuaRan,項目名稱:SmackStudy,代碼行數:17,代碼來源:XMPPUtil.java

示例3: Occupant

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
Occupant(Presence presence) {
    super();
    MUCUser mucUser = (MUCUser) presence.getExtension("x",
            "http://jabber.org/protocol/muc#user");
    MUCUser.Item item = mucUser.getItem();
    this.jid = item.getJid();
    this.affiliation = item.getAffiliation();
    this.role = item.getRole();
    // Get the nickname from the FROM attribute of the presence
    this.nick = StringUtils.parseResource(presence.getFrom());
}
 
開發者ID:ice-coffee,項目名稱:EIM,代碼行數:12,代碼來源:Occupant.java

示例4: getMUCMembers

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
/**
 * ��ȡ�����ҳ�Ա����
 * 
 * @param muc
 * @return
 */
public List<String> getMUCMembers(MultiUserChat muc) {
	List<String> members = new ArrayList<String>();
	Iterator<String> it = muc.getOccupants();
	while (it.hasNext()) {
		String name = StringUtils.parseResource(it.next());
		SLog.i("��Ա����", name);
		members.add(name);
	}
	return members;
}
 
開發者ID:ice-coffee,項目名稱:EIM,代碼行數:17,代碼來源:XmppConnectionManager.java

示例5: processPacket

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
@Override
public void processPacket(Packet packet) {
	// TODO Auto-generated method stub
	SLog.i(tag, packet.toXML());
	Message msg = (Message) packet;
	String from = StringUtils.parseResource(msg.getFrom());
	showToast(from+" ˵��"+msg.getBody());
	
}
 
開發者ID:ice-coffee,項目名稱:EIM,代碼行數:10,代碼來源:MUCRoom.java

示例6: processPacket

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
@Override
	public void processPacket(Packet packet) {
		// TODO Auto-generated method stub
		SLog.i(tag, packet.toXML());
		message = (Message) packet;
		android.os.Message m = new android.os.Message();
		handler.sendEmptyMessage(MESSAGE_TAG);
		
		String from = StringUtils.parseResource(message.getFrom());
		String time = DateUtil.date2Str(Calendar.getInstance(),
				Constant.MS_FORMART);
		RoomMsg rm = new RoomMsg();
//		showToast(from+" ˵��"+message.getBody());
		rm.setCnt(message.getBody());
		rm.setTime(time);
		//��ǰ�û�
		String user = XmppConnectionManager.getInstance().getConnection().getUser();
		if (!from.equals(user)) {
			rm.setType(0); 
			rm.setFrom(from);
			mDataArrays.add(rm);
			int x=mDataArrays.size();
			if (mDataArrays.size() > 30) {
				mDataArrays.remove(0);
			}
		}
		adapter.refresh(mDataArrays);
		//adapter.notifyDataSetChanged();
		android.os.Message ms = new android.os.Message();
		ms.what = 1;
		handler.handleMessage(ms);
		// closeInput();
	}
 
開發者ID:ice-coffee,項目名稱:EIM,代碼行數:34,代碼來源:RoomChatActivity.java

示例7: userHasLogged

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public void userHasLogged(String user) {
    boolean isAnonymous = "".equals(StringUtils.parseName(user));
    String title =
            "User logged (" + connection.hashCode() + "): "
            + (isAnonymous ? "" : StringUtils.parseBareAddress(user))
            + "@"
            + connection.getServiceName()
            + ":"
            + connection.getPort();
    title += "/" + StringUtils.parseResource(user);
    Log.d("SMACK", title);
    // Add the connection listener to the connection so that the debugger can be notified
    // whenever the connection is closed.
    connection.addConnectionListener(connListener);
}
 
開發者ID:samuelhehe,項目名稱:androidpn_enhanced_client,代碼行數:16,代碼來源:AndroidDebugger.java

示例8: userHasLogged

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public void userHasLogged(String user) {
    boolean isAnonymous = "".equals(StringUtils.parseName(user));
    String title =
            "User logged (" + connection.hashCode() + "): "
            + (isAnonymous ? "" : StringUtils.parseBareAddress(user))
            + "@"
            + connection.getServiceName()
            + ":"
            + connection.getPort();
    title += "/" + StringUtils.parseResource(user);
    System.out.println(title);
    // Add the connection listener to the connection so that the debugger can be notified
    // whenever the connection is closed.
    connection.addConnectionListener(connListener);
}
 
開發者ID:samuelhehe,項目名稱:androidpn_enhanced_client,代碼行數:16,代碼來源:ConsoleDebugger.java

示例9: getAbsolutePlayerJID

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
/**
 * Take the room-local JID for a player ([email protected]/nick) and change it into an absolute address for
 * that player ([email protected]/VASSAL)
 *
 * @param jid
 * @return
 */
public String getAbsolutePlayerJID(String jid) {
  return StringUtils.parseResource(jid) + "@" + host + JID_RESOURCE; //$NON-NLS-1$
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:11,代碼來源:JabberClient.java


注:本文中的org.jivesoftware.smack.util.StringUtils.parseResource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。