kom.gateway
Class EnrichedText
java.lang.Object
|
+--kom.gateway.EnrichedText
- public class EnrichedText
- extends java.lang.Object
This code is taken from
RFC1896: The text/enriched MIME Content-type, by P Resnick and A. Walker.
Appendix B--A Simple enriched-to-HTML Translator in C,
translated to Java by
Lars Enderin, DSV KTH/SU, Stockholm, 1998-04-01.
It is fully expected that other text formatting standards like HTML
and SGML will supplant text/enriched in Internet mail. It is also
likely that as this happens, recipients of text/enriched mail will
wish to view such mail with an HTML viewer. To this end, the
following is a simple example of a C program to convert text/enriched
to HTML. Since the current version of HTML at the time of this
document's publication is HTML 2.0 defined in [RFC-1866], this
program converts to that standard. There are several text/enriched
commands that have no HTML 2.0 equivalent. In those cases, this
program simply puts those commands into processing instructions; that
is, surrounded by "" and ">". As in Appendix A, the local newline
convention (the single character represented by "\n") is assumed by
this program, but special CRLF handling might be necessary on some
systems.
Field Summary |
(package private) static int |
tokenSize
|
Method Summary |
static java.lang.String |
convert2html(java.lang.String theText)
Converts "enriched" tags to HTML tags |
static java.lang.StringBuffer |
rich2html(java.lang.String enrichedText)
Does the actual translation of tags |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
tokenSize
static final int tokenSize
EnrichedText
public EnrichedText()
- Constructor
convert2html
public static java.lang.String convert2html(java.lang.String theText)
- Converts "enriched" tags to HTML tags
- Parameters:
theText
- Text to be converted- Returns:
- text with HTML tags
rich2html
public static java.lang.StringBuffer rich2html(java.lang.String enrichedText)
- Does the actual translation of tags
- Parameters:
enrichedText
- Input text/enriched- Returns:
- StringBuffer containing translated text