Package net.sf.statcvs.pages
Class HTML
java.lang.Object
net.sf.statcvs.pages.HTML
TODO: Can we turn this into an abstract base class of MarkupHTML and MarkupXDoc?
- Version:
- $Id: HTML.java,v 1.19 2009/08/05 16:32:10 benoitx Exp $
- Author:
- Anja Jentzsch, Richard Cyganiak (richard@cyganiak.de)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringEscapes HTML meta characters "invalid input: '&'", "invalid input: '<'", ">" and turns "\n" line breaks into HTML line breaks ("
");static StringescapeAuthorName(String authorName) Escapes evil characters in author's names.static StringescapeDirectoryName(String directoryName) static StringEscapes HTML as well as " as it is not valid in URL.static StringescapeUrlParameters(String text) Escapes HTML as well as " as it is not valid in URL.static StringgetAffectedFilesCount(Set files) Returns HTML code for number of affected filesstatic StringgetAuthorIdLink(Author author) Returns HTML code for a link to an author Id pagestatic StringgetAuthorLink(Author author) Returns HTML code for a link to an author pagestatic StringReturns HTML code for a datestatic StringgetDateAndTime(Date date) Returns HTML code for a date, including timestatic StringgetDirectoryLink(Directory directory) Returns HTML code for a directory page linkstatic StringGenerates HTML for an iconstatic StringGenerates HTML for an iconstatic StringCreates a HTML representation of a hyperlinkstatic StringCreates a HTML representation of a hyperlinkstatic StringgetRevisionNumber(String revisionNumber) Returns HTML code for a revision numberstatic StringwebifyLinksFromPlainText(String plainText) From a plain text comment identify the http: and https links and create a link for them.
-
Field Details
-
OUTPUT_DATE_FORMAT
-
OUTPUT_DATE_TIME_FORMAT
-
-
Method Details
-
getLink
Creates a HTML representation of a hyperlink- Parameters:
link- URLlinkName- Name of the Link- Returns:
- String HTML code of the hyperlink
-
getLink
Creates a HTML representation of a hyperlink- Parameters:
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 performed- Returns:
- String HTML code of the hyperlink
-
getAuthorLink
Returns HTML code for a link to an author page- Parameters:
author- the author- Returns:
- HTML code for the link
-
getAuthorIdLink
Returns HTML code for a link to an author Id page- Parameters:
author- the author- Returns:
- HTML code for the link
-
getDate
Returns HTML code for a date- Parameters:
date- the date- Returns:
- HTML code for the date
-
getAffectedFilesCount
Returns HTML code for number of affected files- Parameters:
files- affected files- Returns:
- HTML code for number of affected files
-
getDateAndTime
Returns HTML code for a date, including time- Parameters:
date- the date- Returns:
- HTML code for the date
-
getRevisionNumber
Returns HTML code for a revision number- Parameters:
revisionNumber- a revision number- Returns:
- HTML code for a revision number
-
getDirectoryLink
Returns HTML code for a directory page link- Parameters:
directory- a directory- Returns:
- HTML code for the link
-
getIcon
Generates HTML for an icon- Parameters:
iconFilename- an icon filename (HTMLOutput.XXXX_ICON constants)- Returns:
- HTML string
-
getIcon
Generates HTML for an icon- Parameters:
iconFilename- an icon filename (HTMLOutput.XXXX_ICON constants)title- the title for the icon.- Returns:
- HTML string
-
escapeAuthorName
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 ones- Parameters:
authorName- an author's name- Returns:
- a version safe for creation of files and URLs
-
escapeDirectoryName
-
escape
Escapes HTML meta characters "invalid input: '&'", "invalid input: '<'", ">" and turns "\n" line breaks into HTML line breaks ("
");- Parameters:
text- some string, for example "x > 0 invalid input: '&'invalid input: '&' y invalid input: '<' 100"- Returns:
- HTML-escaped string, for example "x > 0 && y < 100"
-
escapeUrl
Escapes HTML as well as " as it is not valid in URL.- Parameters:
text- some string, for example "x > 0 invalid input: '&'invalid input: '&' y invalid input: '<' 100"- Returns:
- HTML-escaped string, for example "x > 0 && y < 100"
-
escapeUrlParameters
Escapes HTML as well as " as it is not valid in URL.- Parameters:
text- some string, for example "x > 0 invalid input: '&'invalid input: '&' y invalid input: '<' 100"- Returns:
- HTML-escaped string, for example "x > 0 && y < 100"
-
webifyLinksFromPlainText
From a plain text comment identify the http: and https links and create a link for them.- Parameters:
plainText-
-