本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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);
}