# Print output for @column tags ?>
public
abstract
class
AbstractMessageParser
extends Object
java.lang.Object | |
↳ | com.google.android.util.AbstractMessageParser |
Logic for parsing a text message typed by the user looking for smileys, urls, acronyms,formatting (e.g., '*'s for bold), me commands (e.g., "/me is asleep"), and punctuation. It constructs an array, which breaks the text up into its constituent pieces, which we return to the client.
Nested classes | |
---|---|
class |
AbstractMessageParser.Acronym
Represents an acronym that was found in the input. |
class |
AbstractMessageParser.FlickrPhoto
Represents a link to a Flickr photo or album. |
class |
AbstractMessageParser.Format
Represents a character that changes formatting. |
class |
AbstractMessageParser.Html
Represents a simple string of html text. |
class |
AbstractMessageParser.Link
Represents a link that was found in the input. |
class |
AbstractMessageParser.MusicTrack
Represents a music track token at the beginning. |
class |
AbstractMessageParser.Part
Represents set of tokens that are delivered as a single message. |
class |
AbstractMessageParser.Photo
Represents a link to a Picasa photo or album. |
interface |
AbstractMessageParser.Resources
Interface representing the set of resources needed by a message parser |
class |
AbstractMessageParser.Smiley
Represents a smiley that was found in the input. |
class |
AbstractMessageParser.Token
Represents a unit of parsed output. |
class |
AbstractMessageParser.TrieNode
|
class |
AbstractMessageParser.Video
Represents a link to a Google Video. |
class |
AbstractMessageParser.YouTubeVideo
Represents a link to a YouTube video. |
Constants | |
---|---|
String |
musicNote
Music note that indicates user is listening to a music track. |
Public constructors | |
---|---|
AbstractMessageParser(String text)
Create a message parser to parse urls, formatting, acronyms, smileys, /me text and music |
|
AbstractMessageParser(String text, boolean parseSmilies, boolean parseAcronyms, boolean parseFormatting, boolean parseUrls, boolean parseMusic, boolean parseMeText)
Create a message parser, specifying the kinds of text to parse |
Public methods | |
---|---|
final
AbstractMessageParser.Part
|
getPart(int index)
Return the part at the given index. |
final
int
|
getPartCount()
Return the number of parts. |
final
List<AbstractMessageParser.Part>
|
getParts()
Return the list of parts from the parsed text |
final
String
|
getRawText()
Returns the raw text being parsed. |
void
|
parse()
Parses the text string into an internal representation. |
String
|
toHtml()
Converts the entire message into a single HTML display string. |
static
AbstractMessageParser.Token
|
tokenForUrl(String url, String text)
Get a the appropriate Token for a given URL |
Protected methods | |
---|---|
abstract
AbstractMessageParser.Resources
|
getResources()
Subclasses must define the schemes, domains, smileys and acronyms that are necessary for parsing |
static
String
|
reverse(String str)
Returns the reverse of the given string. |
Inherited methods | |
---|---|
public static final String musicNote
Music note that indicates user is listening to a music track.
Constant Value: "♫ "
public AbstractMessageParser (String text)
Create a message parser to parse urls, formatting, acronyms, smileys, /me text and music
Parameters | |
---|---|
text |
String : the text to parse |
public AbstractMessageParser (String text, boolean parseSmilies, boolean parseAcronyms, boolean parseFormatting, boolean parseUrls, boolean parseMusic, boolean parseMeText)
Create a message parser, specifying the kinds of text to parse
Parameters | |
---|---|
text |
String : the text to parse |
parseSmilies |
boolean |
parseAcronyms |
boolean |
parseFormatting |
boolean |
parseUrls |
boolean |
parseMusic |
boolean |
parseMeText |
boolean |
public final AbstractMessageParser.Part getPart (int index)
Return the part at the given index.
Parameters | |
---|---|
index |
int |
Returns | |
---|---|
AbstractMessageParser.Part |
public final int getPartCount ()
Return the number of parts.
Returns | |
---|---|
int |
public final List<AbstractMessageParser.Part> getParts ()
Return the list of parts from the parsed text
Returns | |
---|---|
List<AbstractMessageParser.Part> |
public void parse ()
Parses the text string into an internal representation.
public String toHtml ()
Converts the entire message into a single HTML display string.
Returns | |
---|---|
String |
public static AbstractMessageParser.Token tokenForUrl (String url, String text)
Get a the appropriate Token for a given URL
Parameters | |
---|---|
url |
String : the url |
text |
String : the anchor text |
Returns | |
---|---|
AbstractMessageParser.Token |
protected abstract AbstractMessageParser.Resources getResources ()
Subclasses must define the schemes, domains, smileys and acronyms that are necessary for parsing
Returns | |
---|---|
AbstractMessageParser.Resources |
protected static String reverse (String str)
Returns the reverse of the given string.
Parameters | |
---|---|
str |
String |
Returns | |
---|---|
String |