net.sf.statcvs.pages
public final class HTML extends Object
Modifier and Type | Field and Description |
---|---|
static SimpleDateFormat |
OUTPUT_DATE_FORMAT |
static SimpleDateFormat |
OUTPUT_DATE_TIME_FORMAT |
Modifier and Type | Method and Description |
---|---|
static String |
escape(String text)
Escapes HTML meta characters "&", "<", ">" and turns "\n" line breaks
into HTML line breaks ("
"); |
static String |
escapeAuthorName(String authorName)
Escapes evil characters in author's names.
|
static String |
escapeDirectoryName(String directoryName) |
static String |
escapeUrl(String text)
Escapes HTML as well as " as it is not valid in URL.
|
static String |
escapeUrlParameters(String text)
Escapes HTML as well as " as it is not valid in URL.
|
static String |
getAffectedFilesCount(Set files)
Returns HTML code for number of affected files
|
static String |
getAuthorIdLink(Author author)
Returns HTML code for a link to an author Id page
|
static String |
getAuthorLink(Author author)
Returns HTML code for a link to an author page
|
static String |
getDate(Date date)
Returns HTML code for a date
|
static String |
getDateAndTime(Date date)
Returns HTML code for a date, including time
|
static String |
getDirectoryLink(Directory directory)
Returns HTML code for a directory page link
|
static String |
getIcon(String iconFilename)
Generates HTML for an icon
|
static String |
getIcon(String iconFilename,
String title)
Generates HTML for an icon
|
static String |
getLink(String link,
String linkName)
Creates a HTML representation of a hyperlink
|
static String |
getLink(String link,
String linkName,
String prefix,
String suffix)
Creates a HTML representation of a hyperlink
|
static String |
getRevisionNumber(String revisionNumber)
Returns HTML code for a revision number
|
static String |
webifyLinksFromPlainText(String plainText)
From a plain text comment identify the http: and https links and create a link for them.
|
public static final SimpleDateFormat OUTPUT_DATE_FORMAT
public static final SimpleDateFormat OUTPUT_DATE_TIME_FORMAT
public static String getLink(String link, String linkName)
link
- URLlinkName
- Name of the Linkpublic static String getLink(String link, String linkName, String prefix, String suffix)
link
- URLlinkName
- Name of the Linkprefix
- A prefix to be inserted before the link label; no HTML escaping is performedprefix
- A suffix to be inserted after the link label; no HTML escaping is performedpublic static String getAuthorLink(Author author)
author
- the authorpublic static String getAuthorIdLink(Author author)
author
- the authorpublic static String getDate(Date date)
date
- the datepublic static String getAffectedFilesCount(Set files)
files
- affected filespublic static String getDateAndTime(Date date)
date
- the datepublic static String getRevisionNumber(String revisionNumber)
revisionNumber
- a revision numberpublic static String getDirectoryLink(Directory directory)
directory
- a directorypublic static String getIcon(String iconFilename)
iconFilename
- an icon filename (HTMLOutput.XXXX_ICON constants)public static String getIcon(String iconFilename, String title)
iconFilename
- an icon filename (HTMLOutput.XXXX_ICON constants)title
- the title for the icon.public static String escapeAuthorName(String authorName)
Escapes evil characters in author's names. E.g. "#" must be escaped because for an author "my#name" a page "author_my#name.html" will be created, and you can't link to that in HTML
TODO: Replace everything *but* known good characters, instead of just evil onesauthorName
- an author's namepublic static String escape(String text)
text
- some string, for example "x > 0 && y < 100"public static String escapeUrl(String text)
text
- some string, for example "x > 0 && y < 100"public static String escapeUrlParameters(String text)
text
- some string, for example "x > 0 && y < 100"