|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.speexx.pebble.decorator.Emoticon
Contains the data of an emoticon and the functionality to replace the
emoticon sequence, given by the
regular expression with the HTML sequence
given by getHtml().
| Constructor Summary | |
protected |
Emoticon()
Simple default constructor. |
| Method Summary | |
void |
addAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute for the HTML img element.
|
java.util.Iterator |
attributeIterator()
Returns an Iterator over the attribute names.
|
protected void |
buildHtml()
Build the <img> element. |
java.lang.String |
getAttributeValue(java.lang.String name)
Returns the value for the given attribute name. |
java.lang.String |
getEmoticonRegex()
Returns the emoticon regular expression to decorate in the content with an <img<>, element. |
protected java.lang.String |
getHtml()
Returns the HTML representation of the emoticon. |
java.lang.String |
getImageUrl()
Returns the src attribute part of an <img> element. |
static Emoticon |
newInstance()
Returns a new Emoticon instance. |
java.lang.StringBuffer |
replaceEmoticon(java.lang.StringBuffer content)
Exchange the emoticon characters with an <img> element. |
void |
setEmoticonRegex(java.lang.String emoticon)
Sets the regulare expression to decorate in the content with an <img<>, element. |
void |
setImageUrl(java.lang.String imageUrl)
Sets the value of the src atribute in an <img> element. |
java.lang.String |
toString()
Returns a String representation of the object.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected Emoticon()
| Method Detail |
public static Emoticon newInstance()
Emoticon instance.
Emoticon instance.
public void addAttribute(java.lang.String name,
java.lang.String value)
img element.
If you overwrite this method and don't call the super
method, you must also overwrite attributeIterator() and
getAttributeValue(String).
name - the attribute name.value - the content of the attribute.
java.lang.IllegalArgumentException - if name == null or
value == null or if the
length of name is zero.public java.util.Iterator attributeIterator()
Iterator over the attribute names.
If you overwrite this method and don't call the super
method, you must also overwrite addAttribute(String, String)
and getAttributeValue(String).
public java.lang.String getAttributeValue(java.lang.String name)
If you overwrite this method and don't call the super
method, you must also overwrite addAttribute(String, String)
and attributeIterator().
name - the name of the attribute.
null if the
attribute does not exist.public java.lang.String getImageUrl()
public void setImageUrl(java.lang.String imageUrl)
imageUrl - the value of the src atribute in an
<img> element.public java.lang.String getEmoticonRegex()
public void setEmoticonRegex(java.lang.String emoticon)
throws java.util.regex.PatternSyntaxException
emoticon - thr regulare expression
java.util.regex.PatternSyntaxException - if the emoticon pattern is illegal.public java.lang.String toString()
String representation of the object.
It's possible that the format of the Stringrepresentation
will change in further versions.
String representation of the object.protected java.lang.String getHtml()
protected void buildHtml()
Call this method after changing any data manipulation method (attribute and image URL).
public java.lang.StringBuffer replaceEmoticon(java.lang.StringBuffer content)
content - The content in which a the emoticon characters must be
replaced
java.lang.IllegalStateException - if getEmoticonRegex() returns
null or
getImageUrl() also returns
null.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||