|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cleancode.html.Generator
public class Generator
Provides output formatted for web browsers using HTML.
It derives from the Perl module of the same name, but contains
only a subset of the methods defined there.
TODO convert remaining description from Perl
Nested Class Summary | |
---|---|
static class |
Generator.Test
TODO -- nested test class--move to JUnit. |
Field Summary | |
---|---|
static String |
VERSION
Current version of this class. |
Constructor Summary | |
---|---|
Generator()
Creates a Generator object to generate HTML output. |
Method Summary | |
---|---|
String |
emphasis(String msg)
Builds an italic element. |
String |
escapeHTML(String msg)
Escapes symbols that have special meaning in HTML. |
String |
generic(String tag,
String msg)
Builds a generic tag without attributes. |
String |
generic(String tag,
String msg,
HashMap<String,String> attributes)
Builds a generic tag with attributes. |
String |
genericNL(String tag,
String msg)
Builds a generic tag without attributes but with embedded newlines. |
String |
genericNL(String tag,
String msg,
HashMap<String,String> attributes)
Builds a generic tag with attributes and embedded newlines. |
boolean |
isFormatted(String msg)
Returns a boolean indicating whether the msg is already formatted by this formatter class. |
String |
line(String msg)
Builds a paragraph element without attributes. |
String |
line(String msg,
HashMap<String,String> attributes)
Builds a paragraph element with attributes. |
String |
styleLine(String msg,
String style)
Builds a paragraph with the specified CSS style but no other attributes. |
String |
styleLine(String msg,
String style,
HashMap<String,String> attributes)
Builds a paragraph with the specified CSS style and other attributes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VERSION
Constructor Detail |
---|
public Generator()
Generator
object to generate HTML output.
Method Detail |
---|
public String escapeHTML(String msg)
msg
- message to process
public boolean isFormatted(String msg)
msg
- message to check
public String generic(String tag, String msg, HashMap<String,String> attributes)
tag
- name of tag to generatemsg
- content of elementattributes
- attributes for element
public String generic(String tag, String msg)
tag
- name of tag to generatemsg
- content of element
generic(String, String, HashMap)
public String genericNL(String tag, String msg, HashMap<String,String> attributes)
tag
- name of tag to generatemsg
- content of elementattributes
- attributes for element
public String genericNL(String tag, String msg)
tag
- name of tag to generatemsg
- content of element
genericNL(String, String, HashMap)
public String line(String msg, HashMap<String,String> attributes)
msg
- content of elementattributes
- attributes for element
public String line(String msg)
msg
- content of element
public String styleLine(String msg, String style, HashMap<String,String> attributes)
msg
- content of elementstyle
- CSS style nameattributes
- attributes for element
public String styleLine(String msg, String style)
msg
- content of elementstyle
- CSS style name
public String emphasis(String msg)
msg
- content of element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
CleanCode Java Libraries | Copyright © 2001-2012 Michael Sorens - Revised 2012.12.10 |