public class XHTMLManager extends Object
Constructor and Description |
---|
XHTMLManager() |
Modifier and Type | Method and Description |
---|---|
static void |
addBody(Message message,
String body)
Adds an XHTML body to the message.
|
static List<String> |
getBodies(Message message)
Returns an Iterator for the XHTML bodies in the message.
|
static boolean |
isServiceEnabled(XMPPConnection connection)
Returns true if the XHTML support is enabled for the given connection.
|
static boolean |
isServiceEnabled(XMPPConnection connection,
String userID)
Returns true if the specified user handles XHTML messages.
|
static boolean |
isXHTMLMessage(Message message)
Returns true if the message contains an XHTML extension.
|
static void |
setServiceEnabled(XMPPConnection connection,
boolean enabled)
Enables or disables the XHTML support on a given connection.
|
public XHTMLManager()
public static List<String> getBodies(Message message)
message
- an XHTML messagepublic static void addBody(Message message, String body)
message
- the message that will receive the XHTML bodybody
- the string to add as an XHTML body to the messagepublic static boolean isXHTMLMessage(Message message)
message
- the message to check if contains an XHTML extentsion or notpublic static void setServiceEnabled(XMPPConnection connection, boolean enabled)
Before starting to send XHTML messages to a user, check that the user can handle XHTML messages. Enable the XHTML support to indicate that this client handles XHTML messages.
connection
- the connection where the service will be enabled or disabledenabled
- indicates if the service will be enabled or disabledpublic static boolean isServiceEnabled(XMPPConnection connection)
connection
- the connection to look for XHTML supportpublic static boolean isServiceEnabled(XMPPConnection connection, String userID) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
connection
- the connection to use to perform the service discoveryuserID
- the user to check. A fully qualified xmpp ID, e.g. jdoe@example.comXMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException