public enum TextFormat extends java.lang.Enum<TextFormat>
RAW
format which looks similar to text
but which can contain bold, symbols and links. These issues can
also be converted to plain text and to HTML markup, using the
convertTo(String, TextFormat)
method.Enum Constant and Description |
---|
HTML
HTML formatted output (note: does not include surrounding
<html></html> tags) |
HTML_WITH_UNICODE
HTML formatted output (note: does not include surrounding
<html></html> tags). |
RAW
Raw output format which is similar to text but allows some markup:
HTTP urls (http://...)
Sentences immediately surrounded by * will be shown as bold.
|
TEXT
Plain text output
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
convertTo(java.lang.String message,
TextFormat to)
Converts the given message to the given format.
|
java.lang.String |
toHtml(java.lang.String text)
Converts the given text to HTML
|
java.lang.String |
toText(java.lang.String text)
Converts the given text to plain text
|
static TextFormat |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static TextFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TextFormat RAW
<html>
tags around the fragment for HTML output.
TODO: Consider switching to the restructured text format - http://docutils.sourceforge.net/docs/user/rst/quickstart.html
public static final TextFormat TEXT
public static final TextFormat HTML
<html></html>
tags)public static final TextFormat HTML_WITH_UNICODE
<html></html>
tags).
This is like HTML
, but it does not escape unicode characters with entities.
(This is used for example in the IDE, where some partial HTML support in some label widgets support some HTML markup, but not numeric code character entities.)
public static TextFormat[] values()
for (TextFormat c : TextFormat.values()) System.out.println(c);
public static TextFormat valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null@NonNull public java.lang.String toHtml(@NonNull java.lang.String text)
text
- the text to format@NonNull public java.lang.String toText(@NonNull java.lang.String text)
text
- the tetx to formatpublic java.lang.String convertTo(@NonNull java.lang.String message, @NonNull TextFormat to)
message
- the message to convertto
- the format to convert to