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


Java XmppStringUtils.escapeLocalpart方法代码示例

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


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

示例1: entityBareFromUnescaped

import org.jxmpp.util.XmppStringUtils; //导入方法依赖的package包/类
/**
 * Get a {@link EntityBareJid} representing the given unescaped String.
 *
 * @param unescapedJidString the input String.
 * @return a bare JID representing the given String.
 * @throws XmppStringprepException if an error occurs.
 */
public static EntityBareJid entityBareFromUnescaped(String unescapedJidString) throws XmppStringprepException {
	EntityBareJid bareJid = ENTITY_BAREJID_CACHE.lookup(unescapedJidString);
	if (bareJid != null) {
		return bareJid;
	}

	String localpart = XmppStringUtils.parseLocalpart(unescapedJidString);
	// Some as from(String), but we escape the localpart
	localpart = XmppStringUtils.escapeLocalpart(localpart);

	String domainpart = XmppStringUtils.parseDomain(unescapedJidString);
	try {
		bareJid = new LocalAndDomainpartJid(localpart, domainpart);
	} catch (XmppStringprepException e) {
		throw new XmppStringprepException(unescapedJidString, e);
	}
	ENTITY_BAREJID_CACHE.put(unescapedJidString, bareJid);
	return bareJid;
}
 
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:27,代码来源:JidCreate.java

示例2: entityFullFromUnescaped

import org.jxmpp.util.XmppStringUtils; //导入方法依赖的package包/类
/**
 * Get a {@link EntityFullJid} representing the given unescaped String.
 *
 * @param unescapedJidString the JID's String.
 * @return a full JID representing the input String.
 * @throws XmppStringprepException if an error occurs.
 */
public static EntityFullJid entityFullFromUnescaped(String unescapedJidString) throws XmppStringprepException {
	EntityFullJid fullJid = ENTITY_FULLJID_CACHE.lookup(unescapedJidString);
	if (fullJid != null) {
		return fullJid;
	}

	String localpart = XmppStringUtils.parseLocalpart(unescapedJidString);
	// Some as from(String), but we escape the localpart
	localpart = XmppStringUtils.escapeLocalpart(localpart);

	String domainpart = XmppStringUtils.parseDomain(unescapedJidString);
	String resource = XmppStringUtils.parseResource(unescapedJidString);
	try {
		fullJid = new LocalDomainAndResourcepartJid(localpart, domainpart, resource);
	} catch (XmppStringprepException e) {
		throw new XmppStringprepException(unescapedJidString, e);
	}

	ENTITY_FULLJID_CACHE.put(unescapedJidString, fullJid);
	return fullJid;
}
 
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:29,代码来源:JidCreate.java

示例3: fromUnescaped

import org.jxmpp.util.XmppStringUtils; //导入方法依赖的package包/类
/**
 * Get a {@link Jid} from the given unescaped String.
 *
 * @param unescapedJidString a unescaped String representing a JID.
 * @return a JID.
 * @throws XmppStringprepException if an error occurs.
 */
public static Jid fromUnescaped(String unescapedJidString) throws XmppStringprepException {
	String localpart = XmppStringUtils.parseLocalpart(unescapedJidString);
	// Some as from(String), but we escape the localpart
	localpart = XmppStringUtils.escapeLocalpart(localpart);

	String domainpart = XmppStringUtils.parseDomain(unescapedJidString);
	String resource = XmppStringUtils.parseResource(unescapedJidString);
	try {
		return from(localpart, domainpart, resource);
	} catch (XmppStringprepException e) {
		throw new XmppStringprepException(unescapedJidString, e);
	}
}
 
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:21,代码来源:JidCreate.java

示例4: escape

import org.jxmpp.util.XmppStringUtils; //导入方法依赖的package包/类
private static JID escape(String local, String domain, String resource) {
    return new JID(XmppStringUtils.escapeLocalpart(local), domain, resource);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:4,代码来源:JID.java


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