|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mindoo.xpages2eclipse.tools.StringConverter
public class StringConverter

Various text conversion tools
| Nested Class Summary | |
|---|---|
protected static class |
StringConverter.RTFEncoder
|
| Constructor Summary | |
|---|---|
StringConverter()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
concatenateStrings(java.lang.String str1,
java.lang.String str2,
java.lang.String middleText,
boolean middleTextIsHtml)
Concatenates two strings. |
static java.lang.String |
encodeInHTML(java.lang.String text)
This method converts the provided plain text string into HTML compliant text, which for example can be inserted in the body of a HTML document Example: The method converts Test\nTest2 into Test<br>Test2
and it converts <b>Test</b> into <b>Test</b>. |
static java.lang.String |
encodeInRTF(java.lang.String text)
Diese Methode konvertiert den plain-Text des übergebenen Strings in RTF-konformen Text. |
static java.lang.String |
extractTextFromHtml(java.lang.String htmlText)
Extracts the plain text from HTML |
static java.lang.String |
getHexString(byte[] raw)
Returns the given byte-array as a hex string. |
static java.lang.String |
prepareForHTML(java.lang.String text)
This method checks of the specified text contains HTML (searches for HTML tags at the beginning and the end of the string) and removes encosing HTML tags. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringConverter()
| Method Detail |
|---|
public static java.lang.String encodeInHTML(java.lang.String text)
Test\nTest2 into Test<br>Test2
<b>Test</b> into <b>Test</b>.
text -
public static java.lang.String prepareForHTML(java.lang.String text)
encodeInHTML(String).
In any case, the returned text can get inserted directly into a HTML string.
text - text to be converted
public static java.lang.String concatenateStrings(java.lang.String str1,
java.lang.String str2,
java.lang.String middleText,
boolean middleTextIsHtml)
str1 - String 1str2 - String 2middleText - Text between both strings
public static java.lang.String encodeInRTF(java.lang.String text)
text -
public static java.lang.String extractTextFromHtml(java.lang.String htmlText)
htmlText - HTML
public static java.lang.String getHexString(byte[] raw)
throws java.io.UnsupportedEncodingException
raw - the byte array
java.io.UnsupportedEncodingException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||