Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.webchat.utils
Class WebUtils

java.lang.Object
  extended by com.jivesoftware.webchat.utils.WebUtils

public final class WebUtils
extends java.lang.Object

The WebUtils class is a utility class for some of the most mundane procedures in the WebChat client and in servlet programming. This will be moved over to a more suitable class down the line. Probably be handled in the com.jivesoftware.web.utils package to be used throughout Jive.


Method Summary
static java.lang.String applyFilters(java.lang.String body)
          Applies all text filters to the given text.
static java.lang.String getMUCServiceName(org.jivesoftware.smack.XMPPConnection con)
          Returns the service name for MUC.
static java.lang.String getNickname(org.jivesoftware.smack.packet.Message message)
          Returns the nickname of the user who sent the message.
static boolean isAvailable(org.jivesoftware.smack.packet.Presence presence)
           
static boolean isNotNull(java.lang.String str)
          Check to see if string has been assigned a value.
static boolean isTrue(java.lang.String str)
          Checks to see if the String is boolean value and will return the appropriate value
static void main(java.lang.String[] args)
           
static java.lang.String replace(java.lang.String string, java.lang.String oldString, java.lang.String newString)
          Replaces all instances of oldString with newString in string.
static boolean validateChars(java.lang.String text)
          Validate the given text
static boolean validateSubject(java.lang.String text)
          Validate the given text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNotNull

public static final boolean isNotNull(java.lang.String str)
Check to see if string has been assigned a value. This is generally used in web applications/applet when a user request a parameter from the parameter stack.

Parameters:
str - - the string to check.
Returns:
true if String has been assigned a value, false otherwise.

isTrue

public static final boolean isTrue(java.lang.String str)
Checks to see if the String is boolean value and will return the appropriate value

Parameters:
str - - the String to check
Returns:
true if the string is not null and the value is equal to true, false otherwise.

isAvailable

public static final boolean isAvailable(org.jivesoftware.smack.packet.Presence presence)

validateChars

public static final boolean validateChars(java.lang.String text)
Validate the given text

Parameters:
text - the text to check
Returns:
true if the given text is valid, false otherwise.

validateSubject

public static final boolean validateSubject(java.lang.String text)
Validate the given text

Parameters:
text - the text to check
Returns:
true if the given text is valid, false otherwise.

applyFilters

public static java.lang.String applyFilters(java.lang.String body)
Applies all text filters to the given text.

Parameters:
body - the body of text to filter.
Returns:
the given string with all filters applied.

replace

public static final java.lang.String replace(java.lang.String string,
                                             java.lang.String oldString,
                                             java.lang.String newString)
Replaces all instances of oldString with newString in string.

Parameters:
string - the String to search to perform replacements on
oldString - the String that should be replaced by newString
newString - the String that will replace all instances of oldString
Returns:
a String will all instances of oldString replaced by newString

getNickname

public static java.lang.String getNickname(org.jivesoftware.smack.packet.Message message)
Returns the nickname of the user who sent the message.(ex.foo@jivesoftware.com/john), would return john.

Parameters:
message - the message recieved.
Returns:
the nickname of the user who send the message.

getMUCServiceName

public static java.lang.String getMUCServiceName(org.jivesoftware.smack.XMPPConnection con)
Returns the service name for MUC.

Returns:
the MUC Service Name

main

public static void main(java.lang.String[] args)

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.