public class JidCreate
extends java.lang.Object
If the input was user generated, e.g. captured from some sort of user
interface, fromUnescaped(String) should be used instead. This allows
the user to enter unescaped JID values. You can use
JidUtil.isValidEntityBareJid(CharSequence) to
query, e.g. while the user it entering it, if a given CharSequence is a valid
bare JID.
JIDs created from input received from an XMPP source should use
from(String).
JidCreate uses caches for efficient Jid construction, But it's not guaranteed that the same String or CharSequence will yield the same Jid instance.
Jid| Constructor and Description |
|---|
JidCreate() |
| Modifier and Type | Method and Description |
|---|---|
static BareJid |
bareFrom(java.lang.CharSequence jid)
Get a
BareJid representing the given CharSequence. |
static BareJid |
bareFrom(Localpart localpart,
DomainBareJid domainBareJid)
|
static BareJid |
bareFrom(Localpart localpart,
Domainpart domain)
|
static BareJid |
bareFrom(java.lang.String jid)
Get a
BareJid representing the given String. |
static BareJid |
bareFromOrThrowUnchecked(java.lang.CharSequence cs)
Like
bareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static DomainBareJid |
domainBareFrom(java.lang.CharSequence jid)
Get a domain bare JID.
|
static DomainBareJid |
domainBareFrom(Domainpart domainpart)
Get a
DomainBareJid consisting of the given Domainpart. |
static DomainBareJid |
domainBareFrom(java.lang.String jid)
Get a domain bare JID.
|
static DomainBareJid |
domainBareFromOrThrowUnchecked(java.lang.CharSequence cs)
Like
domainBareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static DomainFullJid |
domainFullFrom(java.lang.CharSequence jid)
Get a domain full JID from the given CharSequence.
|
static DomainFullJid |
domainFullFrom(DomainBareJid domainBareJid,
Resourcepart resource)
Get a domain full JID.
|
static DomainFullJid |
domainFullFrom(Domainpart domainpart,
Resourcepart resource)
Get a domain full JID.
|
static DomainFullJid |
domainFullFrom(java.lang.String jid)
Get a domain full JID from the given String.
|
static DomainFullJid |
domainFullFromOrThrowUnchecked(java.lang.CharSequence cs)
Like
domainFullFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static DomainFullJid |
donmainFullFrom(java.lang.String jid)
Deprecated.
use
domainFullFrom(String) instead. |
static EntityBareJid |
entityBareFrom(java.lang.CharSequence jid)
Get a
EntityBareJid representing the given CharSequence. |
static EntityBareJid |
entityBareFrom(Localpart localpart,
DomainBareJid domainBareJid)
Get a
EntityBareJid constructed from the given Localpart and {link DomainBareJid}. |
static EntityBareJid |
entityBareFrom(Localpart localpart,
Domainpart domain)
|
static EntityBareJid |
entityBareFrom(java.lang.String jid)
Get a
EntityBareJid representing the given String. |
static EntityBareJid |
entityBareFromOrThrowUnchecked(java.lang.CharSequence cs)
Like
entityBareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static EntityBareJid |
entityBareFromUnescaped(java.lang.CharSequence unescapedJid)
Get a
EntityBareJid representing the given unescaped CharSequence. |
static EntityBareJid |
entityBareFromUnescaped(java.lang.String unescapedJidString)
Get a
EntityBareJid representing the given unescaped String. |
static EntityBareJid |
entityBareFromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
Like
entityBareFromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static EntityJid |
entityFrom(java.lang.CharSequence jid)
Get a
EntityJid representing the given String. |
static EntityJid |
entityFrom(java.lang.String jidString)
Get a
EntityJid representing the given String. |
static EntityJid |
entityFromOrThrowUnchecked(java.lang.CharSequence cs)
Like
entityFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static EntityJid |
entityFromUnescaped(java.lang.CharSequence jid)
Get a
EntityJid representing the given String. |
static EntityJid |
entityFromUnescaped(java.lang.String jidString)
Get a
EntityJid representing the given String. |
static EntityJid |
entityFromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
Like
entityFromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static EntityFullJid |
entityFullFrom(java.lang.CharSequence jid)
Get a
EntityFullJid representing the given CharSequence. |
static EntityFullJid |
entityFullFrom(EntityBareJid bareJid,
Resourcepart resource)
|
static EntityFullJid |
entityFullFrom(Localpart localpart,
DomainBareJid domainBareJid,
Resourcepart resource)
Get a
EntityFullJid constructed from the given parts. |
static EntityFullJid |
entityFullFrom(Localpart localpart,
Domainpart domainpart,
Resourcepart resource)
Get a
EntityFullJid constructed from the given parts. |
static EntityFullJid |
entityFullFrom(java.lang.String jid)
Get a
EntityFullJid representing the given String. |
static EntityFullJid |
entityFullFrom(java.lang.String localpart,
java.lang.String domainpart,
java.lang.String resource)
Get a
EntityFullJid constructed from the given parts. |
static EntityFullJid |
entityFullFromOrThrowUnchecked(java.lang.CharSequence cs)
Like
entityFullFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static EntityFullJid |
entityFullFromUnescaped(java.lang.CharSequence unescapedJid)
Get a
EntityFullJid representing the given unescaped CharSequence. |
static EntityFullJid |
entityFullFromUnescaped(java.lang.String unescapedJidString)
Get a
EntityFullJid representing the given unescaped String. |
static EntityFullJid |
entityFullFromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
Like
entityFullFromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static Jid |
from(java.lang.CharSequence jid)
Get a
Jid from a CharSequence. |
static Jid |
from(java.lang.CharSequence localpart,
java.lang.CharSequence domainpart,
java.lang.CharSequence resource)
Get a
Jid from the given parts. |
static Jid |
from(java.lang.String jidString)
Get a
Jid from the given String. |
static Jid |
from(java.lang.String localpart,
java.lang.String domainpart,
java.lang.String resource)
Get a
Jid from the given parts. |
static Jid |
fromOrThrowUnchecked(java.lang.CharSequence cs)
Like
from(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static Jid |
fromUnescaped(java.lang.CharSequence unescapedJid)
Get a
Jid from the given unescaped CharSequence. |
static Jid |
fromUnescaped(java.lang.String unescapedJidString)
Get a
Jid from the given unescaped String. |
static Jid |
fromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
Like
fromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static FullJid |
fullFrom(java.lang.CharSequence jid)
Get a
FullJid representing the given CharSequence. |
static EntityFullJid |
fullFrom(EntityBareJid bareJid,
Resourcepart resource)
|
static FullJid |
fullFrom(Localpart localpart,
DomainBareJid domainBareJid,
Resourcepart resource)
Get a
FullJid constructed from the given parts. |
static FullJid |
fullFrom(Localpart localpart,
Domainpart domainpart,
Resourcepart resource)
Get a
FullJid constructed from the given parts. |
static FullJid |
fullFrom(java.lang.String jid)
Get a
FullJid representing the given String. |
static FullJid |
fullFrom(java.lang.String localpart,
java.lang.String domainpart,
java.lang.String resource)
Get a
FullJid constructed from the given parts. |
static FullJid |
fullFromOrThrowUnchecked(java.lang.CharSequence cs)
Like
fullFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static DomainBareJid |
serverBareFrom(java.lang.String jid)
Deprecated.
use
domainBareFrom(String) instead |
static DomainFullJid |
serverFullFrom(java.lang.String jid)
Deprecated.
use
domainFullFrom(String) instead |
public static Jid from(java.lang.CharSequence localpart, java.lang.CharSequence domainpart, java.lang.CharSequence resource) throws org.jxmpp.stringprep.XmppStringprepException
Jid from the given parts.
Only the domainpart is required.
localpart - a optional localpart.domainpart - a required domainpart.resource - a optional resourcepart.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static Jid from(java.lang.String localpart, java.lang.String domainpart, java.lang.String resource) throws org.jxmpp.stringprep.XmppStringprepException
Jid from the given parts.
Only the domainpart is required.
localpart - a optional localpart.domainpart - a required domainpart.resource - a optional resourcepart.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static Jid fromOrThrowUnchecked(java.lang.CharSequence cs)
from(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a JidJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDfrom(String)public static Jid from(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
Jid from a CharSequence.jid - the input CharSequence.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.from(String)public static Jid from(java.lang.String jidString) throws org.jxmpp.stringprep.XmppStringprepException
Jid from the given String.jidString - the input String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.from(CharSequence)public static Jid fromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
fromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a JidJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDfromUnescaped(CharSequence)public static Jid fromUnescaped(java.lang.CharSequence unescapedJid) throws org.jxmpp.stringprep.XmppStringprepException
Jid from the given unescaped CharSequence.unescapedJid - an unescaped CharSequence representing a JID.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static Jid fromUnescaped(java.lang.String unescapedJidString) throws org.jxmpp.stringprep.XmppStringprepException
Jid from the given unescaped String.unescapedJidString - a unescaped String representing a JID.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static BareJid bareFromOrThrowUnchecked(java.lang.CharSequence cs)
bareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a BareJidBareJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDbareFrom(CharSequence)public static BareJid bareFrom(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
BareJid representing the given CharSequence.jid - the input CharSequence.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static BareJid bareFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
BareJid representing the given String.jid - the input String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static BareJid bareFrom(Localpart localpart, DomainBareJid domainBareJid)
localpart - a optional localpart.domainBareJid - a domain bare JID.public static BareJid bareFrom(Localpart localpart, Domainpart domain)
localpart - a optional localpart.domain - a domainpart.public static FullJid fullFromOrThrowUnchecked(java.lang.CharSequence cs)
fullFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a FullJidFullJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDfullFrom(CharSequence)public static FullJid fullFrom(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
FullJid representing the given CharSequence.jid - a CharSequence representing a JID.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static FullJid fullFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
FullJid representing the given String.jid - the JID's String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static FullJid fullFrom(java.lang.String localpart, java.lang.String domainpart, java.lang.String resource) throws org.jxmpp.stringprep.XmppStringprepException
FullJid constructed from the given parts.localpart - a optional localpart.domainpart - a domainpart.resource - a resourcepart.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static FullJid fullFrom(Localpart localpart, DomainBareJid domainBareJid, Resourcepart resource)
FullJid constructed from the given parts.localpart - a optional localpart.domainBareJid - a domain bare JID.resource - a resourcepartpublic static FullJid fullFrom(Localpart localpart, Domainpart domainpart, Resourcepart resource)
FullJid constructed from the given parts.localpart - the optional localpart.domainpart - the domainpart.resource - the resourcepart.public static EntityJid entityFromOrThrowUnchecked(java.lang.CharSequence cs)
entityFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a EntityJidEntityJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDentityFrom(CharSequence)public static EntityFullJid fullFrom(EntityBareJid bareJid, Resourcepart resource)
bareJid - a entity bare JID.resource - a resourcepart.public static EntityJid entityFrom(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
EntityJid representing the given String.jid - the JID's string.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityJid entityFrom(java.lang.String jidString) throws org.jxmpp.stringprep.XmppStringprepException
EntityJid representing the given String.jidString - the JID's string.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityJid entityFromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
entityFromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a EntityJidEntityJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDentityFromUnescaped(CharSequence)public static EntityJid entityFromUnescaped(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
EntityJid representing the given String.jid - the JID.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityJid entityFromUnescaped(java.lang.String jidString) throws org.jxmpp.stringprep.XmppStringprepException
EntityJid representing the given String.jidString - the JID's string.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityBareJid entityBareFromOrThrowUnchecked(java.lang.CharSequence cs)
entityBareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a EntityBareJidEntityBareJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDentityBareFrom(CharSequence)public static EntityBareJid entityBareFrom(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
EntityBareJid representing the given CharSequence.jid - the input CharSequence.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityBareJid entityBareFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
EntityBareJid representing the given String.jid - the input String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityBareJid entityBareFromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
entityBareFromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a EntityBareJidEntityBareJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDentityBareFromUnescaped(CharSequence)public static EntityBareJid entityBareFromUnescaped(java.lang.CharSequence unescapedJid) throws org.jxmpp.stringprep.XmppStringprepException
EntityBareJid representing the given unescaped CharSequence.unescapedJid - the input CharSequence.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityBareJid entityBareFromUnescaped(java.lang.String unescapedJidString) throws org.jxmpp.stringprep.XmppStringprepException
EntityBareJid representing the given unescaped String.unescapedJidString - the input String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityBareJid entityBareFrom(Localpart localpart, DomainBareJid domainBareJid)
EntityBareJid constructed from the given Localpart and {link DomainBareJid}.localpart - a localpart.domainBareJid - a domain bare JID.public static EntityBareJid entityBareFrom(Localpart localpart, Domainpart domain)
localpart - a localpart.domain - a domainpart.public static EntityFullJid entityFullFromOrThrowUnchecked(java.lang.CharSequence cs)
entityFullFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a EntityFullJidEntityFullJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDentityFullFrom(CharSequence)public static EntityFullJid entityFullFrom(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
EntityFullJid representing the given CharSequence.jid - a CharSequence representing a JID.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityFullJid entityFullFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
EntityFullJid representing the given String.jid - the JID's String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityFullJid entityFullFromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
entityFullFromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a EntityFullJidEntityFullJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDentityFullFromUnescaped(CharSequence)public static EntityFullJid entityFullFromUnescaped(java.lang.CharSequence unescapedJid) throws org.jxmpp.stringprep.XmppStringprepException
EntityFullJid representing the given unescaped CharSequence.unescapedJid - a CharSequence representing a JID.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityFullJid entityFullFromUnescaped(java.lang.String unescapedJidString) throws org.jxmpp.stringprep.XmppStringprepException
EntityFullJid representing the given unescaped String.unescapedJidString - the JID's String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityFullJid entityFullFrom(java.lang.String localpart, java.lang.String domainpart, java.lang.String resource) throws org.jxmpp.stringprep.XmppStringprepException
EntityFullJid constructed from the given parts.localpart - a localpart.domainpart - a domainpart.resource - a resourcepart.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static EntityFullJid entityFullFrom(Localpart localpart, DomainBareJid domainBareJid, Resourcepart resource)
EntityFullJid constructed from the given parts.localpart - a localpart.domainBareJid - a domain bare JID..resource - a resourcepartpublic static EntityFullJid entityFullFrom(Localpart localpart, Domainpart domainpart, Resourcepart resource)
EntityFullJid constructed from the given parts.localpart - the localpart.domainpart - the domainpart.resource - the resourcepart.public static EntityFullJid entityFullFrom(EntityBareJid bareJid, Resourcepart resource)
bareJid - a bare JID.resource - a resourcepart.@Deprecated public static DomainBareJid serverBareFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
domainBareFrom(String) insteadjid - the JID.org.jxmpp.stringprep.XmppStringprepException - if an error happens.public static DomainBareJid domainBareFromOrThrowUnchecked(java.lang.CharSequence cs)
domainBareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a EntityFullJidEntityFullJid if no exception occursfrom(String)public static DomainBareJid domainBareFrom(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
jid - the JID CharSequence.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static DomainBareJid domainBareFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
jid - the JID String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static DomainBareJid domainBareFrom(Domainpart domainpart)
DomainBareJid consisting of the given Domainpart.domainpart - the domainpart.@Deprecated public static DomainFullJid serverFullFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
domainFullFrom(String) insteadjid - the JID.org.jxmpp.stringprep.XmppStringprepException - if an error happens.@Deprecated public static DomainFullJid donmainFullFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
domainFullFrom(String) instead.jid - the JID.org.jxmpp.stringprep.XmppStringprepException - if an error happens.public static DomainFullJid domainFullFromOrThrowUnchecked(java.lang.CharSequence cs)
domainFullFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a DomainFullJidDomainFullJid if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid JIDdomainFullFrom(CharSequence)public static DomainFullJid domainFullFrom(java.lang.CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
jid - the JID.org.jxmpp.stringprep.XmppStringprepException - if an error happens.public static DomainFullJid domainFullFrom(java.lang.String jid) throws org.jxmpp.stringprep.XmppStringprepException
jid - the JID.org.jxmpp.stringprep.XmppStringprepException - if an error happens.public static DomainFullJid domainFullFrom(Domainpart domainpart, Resourcepart resource)
domainpart - the domainpart.resource - the resourcepart.public static DomainFullJid domainFullFrom(DomainBareJid domainBareJid, Resourcepart resource)
domainBareJid - a domain bare JID.resource - a resourcepart.