blackboard.base
Class FormattedText

java.lang.Object
  extended by blackboard.base.FormattedText
All Implemented Interfaces:
java.io.Serializable

public class FormattedText
extends java.lang.Object
implements java.io.Serializable

The FormattedText class provides a means for storing a piece of text along with a companion formatting specification. FormattedText objects encapsulate Smart Text, Plain Text, and HTML Text as used in the user interface.

Since:
Bb 5.5
See Also:
Serialized Form

Nested Class Summary
static class FormattedText.Type
          Enumeration class to specify possible text formats.
 
Constructor Summary
FormattedText()
          Default constructor; creates an empty string with FormattedText.Type.SMART.
FormattedText(java.lang.String strText, FormattedText.Type eType)
          Constructor, presets the string value and type.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Overrides the equals() method in Object to provide a simple way to compare two FormattedText objects.
 java.lang.String getFormattedText()
          Renders the formatted text object.
 java.lang.String getText()
          Returns the text associated with this FormattedText.
 FormattedText.Type getType()
          Returns the format type for this FormattedText.
 int hashCode()
           
static FormattedText toFormattedText(java.lang.String text)
          Creates a FormattedText from the specified String using the default FormattedText type.
 java.lang.String toString()
          Returns the contents of this BbFile object as a single line separated list of name value pairs of this object's properties.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormattedText

public FormattedText()
Default constructor; creates an empty string with FormattedText.Type.SMART.


FormattedText

public FormattedText(java.lang.String strText,
                     FormattedText.Type eType)
Constructor, presets the string value and type.

Method Detail

getType

public FormattedText.Type getType()
Returns the format type for this FormattedText.

Returns:
a type value as defined in FormattedText.Type
See Also:
FormattedText.Type

getText

public java.lang.String getText()
Returns the text associated with this FormattedText.

Returns:
the text value of this FormattedText as a String

getFormattedText

public java.lang.String getFormattedText()
Renders the formatted text object.


toFormattedText

public static FormattedText toFormattedText(java.lang.String text)
Creates a FormattedText from the specified String using the default FormattedText type.

Parameters:
text - String to convert to FormattedText
Returns:
FormattedText of the specified String

equals

public boolean equals(java.lang.Object obj)
Overrides the equals() method in Object to provide a simple way to compare two FormattedText objects.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to be compared.
Returns:
true if the two Objects are the same, false otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns the contents of this BbFile object as a single line separated list of name value pairs of this object's properties. This method can be used for debug purposes.

Overrides:
toString in class java.lang.Object
Returns:
a String that represents the contents of this object


Copyright © 2012 Blackboard, Inc. All Rights Reserved.