public final class MalformedJid
extends java.lang.Object
Represents a malformed JID in order to handle the jid-malformed error.
This class is not intended to be publicly instantiable, but is used for malformed JIDs during parsing automatically.
ESCAPING_FEATURE, MAX_BARE_JID_LENGTH, MAX_FULL_JID_LENGTH| Modifier and Type | Method and Description |
|---|---|
Jid |
asBareJid()
Gets the bare JID representation of this JID, i.e. removes the resource part.
|
Jid |
atSubdomain(java.lang.CharSequence subdomain)
Creates a new JID at a subdomain and at the same domain as this JID.
|
char |
charAt(int index) |
int |
compareTo(Jid o)
Compares this JID with another JID.
|
boolean |
equals(java.lang.Object o) |
java.lang.Throwable |
getCause()
Gets the cause why the JID is malformed.
|
java.lang.String |
getDomain()
Gets the domain part.
|
java.lang.String |
getEscapedLocal()
Gets the escaped local part of the JID.
|
java.lang.String |
getLocal()
Gets the local part of the JID, also known as the name or node.
|
java.lang.String |
getResource()
Gets the resource part.
|
int |
hashCode() |
boolean |
isBareJid()
Checks if the JID is a bare JID.
|
boolean |
isDomainJid()
Checks if the JID is a domain JID, i.e. if it has no local part.
|
boolean |
isFullJid()
Checks if the JID is a full JID.
|
int |
length() |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toEscapedString()
Returns the JID in escaped form as described in XEP-0106: JID Escaping.
|
java.lang.String |
toString()
Returns the JID in its string representation, i.e. [ localpart "@" ] domainpart [ "/" resourcepart ].
|
Jid |
withLocal(java.lang.CharSequence local)
Creates a new JID with a new local part and the same domain and resource part of the current JID.
|
Jid |
withResource(java.lang.CharSequence resource)
Creates a new full JID with a resource and the same local and domain part of the current JID.
|
of, of, ofDomain, ofDomainAndResource, ofEscaped, ofLocalAndDomainpublic final Jid asBareJid()
JidGets the bare JID representation of this JID, i.e. removes the resource part.
The term “bare JID” refers to an XMPP address of the form <localpart@domainpart> (for an account at a server) or of the form <domainpart> (for a server).
Jid.withResource(CharSequence)public Jid withLocal(java.lang.CharSequence local)
JidCreates a new JID with a new local part and the same domain and resource part of the current JID.
local - The local part.Jid.withResource(CharSequence)public Jid withResource(java.lang.CharSequence resource)
JidCreates a new full JID with a resource and the same local and domain part of the current JID.
resource - The resource.Jid.asBareJid(),
Jid.withLocal(CharSequence)public Jid atSubdomain(java.lang.CharSequence subdomain)
JidCreates a new JID at a subdomain and at the same domain as this JID.
subdomain - The subdomain.public final java.lang.String getLocal()
JidGets the local part of the JID, also known as the name or node.
The localpart of a JID is an optional identifier placed before the domainpart and separated from the latter by the ‘@’ character. Typically, a localpart uniquely identifies the entity requesting and using network access provided by a server (i.e., a local account), although it can also represent other kinds of entities (e.g., a chatroom associated with a multi-user chat service [XEP-0045]). The entity represented by an XMPP localpart is addressed within the context of a specific domain (i.e., <localpart@domainpart>).
Jid.getEscapedLocal()public final java.lang.String getEscapedLocal()
JidGets the escaped local part of the JID.
Jid.getLocal()public final java.lang.String getDomain()
JidGets the domain part.
The domainpart is the primary identifier and is the only REQUIRED element of a JID (a mere domainpart is a valid JID). Typically, a domainpart identifies the “home” server to which clients connect for XML routing and data management functionality.
public final java.lang.String getResource()
JidGets the resource part.
The resourcepart of a JID is an optional identifier placed after the domainpart and separated from the latter by the ‘/’ character. A resourcepart can modify either a <localpart@domainpart> address or a mere <domainpart> address. Typically, a resourcepart uniquely identifies a specific connection (e.g., a device or location) or object (e.g., an occupant in a multi-user chatroom [XEP-0045]) belonging to the entity associated with an XMPP localpart at a domain (i.e., <localpart@domainpart/resourcepart>).
public final java.lang.Throwable getCause()
Gets the cause why the JID is malformed.
public final boolean isFullJid()
The term "full JID" refers to an XMPP address of the form <localpart@domainpart/resourcepart> (for a particular authorized client or device associated with an account) or of the form <domainpart/resourcepart> (for a particular resource or script associated with a server).
public final boolean isBareJid()
The term "bare JID" refers to an XMPP address of the form <localpart@domainpart> (for an account at a server) or of the form <domainpart> (for a server).
public final boolean isDomainJid()
JidChecks if the JID is a domain JID, i.e. if it has no local part.
isDomainJid in interface Jidpublic final boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic final int compareTo(Jid o)
compareTo in interface java.lang.Comparable<Jid>o - The other JID.public final int length()
length in interface java.lang.CharSequencepublic final char charAt(int index)
charAt in interface java.lang.CharSequencepublic final java.lang.CharSequence subSequence(int start,
int end)
subSequence in interface java.lang.CharSequencepublic final java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.ObjecttoEscapedString()public final java.lang.String toEscapedString()
JidReturns the JID in escaped form as described in XEP-0106: JID Escaping.
toEscapedString in interface JidCharSequence.toString()Copyright © 2014–2019 XMPP.rocks. All rights reserved.