Class XML
java.lang.Object
net.sf.statcvs.pages.xml.XML
TODO: Can we turn this into an abstract base class of MarkupHTML and MarkupXDoc?
- Version:
- $Id: XML.java,v 1.5 2009/03/13 23:04:28 benoitx Exp $
- Author:
- Anja Jentzsch, Richard Cyganiak (richard@cyganiak.de)
-
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 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 StringCreates a HTML representation of a hyperlinkstatic StringCreates a HTML representation of a hyperlink
-
Method Details
-
getLink
-
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
-
getAuthorIdLink
-
getDate
-
getDateAndTime
-
getDirectoryLink
-
getIcon
-
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"
-