jdiff
Class Comments
public
class
Comments
extends Object
Creates a Comments from an XML file. The Comments object is the internal
representation of the comments for the changes.
All methods in this class for populating a Comments object are static.
See the file LICENSE.txt for copyright details.
Method Summary |
void | addComment(SingleComment comment)
Add the SingleComment object to the list of comments kept by this
object. |
static String | convertAtLinks(String text, String currentElement, PackageAPI pkg, ClassAPI cls)
Convert @link tags to HTML links. |
void | dump()
Dump the contents of a Comments object out for inspection. |
void | emitComments()
Write the Comments object out in XML. |
void | emitXMLFooter()
Emit the XML footer. |
void | emitXMLHeader(String filename)
Emit the XML header. |
static String | getComment(Comments comments, String id)
Return the comment associated with the given id in the Comment object.
|
static boolean | isMinimizedTag(String tag)
Return true if the given HTML tag has no separate end element.
|
static void | noteDifferences(Comments oldComments, Comments newComments)
Emit messages about which comments are now unused and which are new. |
static Comments | readFile(String filename)
Read the file where the XML for comments about the changes between
the old API and new API is stored and create a Comments object for
it. |
static boolean | writeFile(String outputFileName, Comments newComments)
Write the XML representation of comments to a file.
|
static void | writeXSD(String filename)
Write the XML Schema file used for validation. |
public static Hashtable allPossibleComments
All the possible comments known about, accessible by the commentID.
public List commentsList_
public static final String placeHolderText
The text placed into XML comments file where there is no comment yet.
It never appears in reports.
public Comments()
Default constructor.
public void addComment(SingleComment comment)
Add the SingleComment object to the list of comments kept by this
object.
public static String convertAtLinks(String text, String currentElement, PackageAPI pkg, ClassAPI cls)
Convert @link tags to HTML links.
public void dump()
Dump the contents of a Comments object out for inspection.
public void emitComments()
Write the Comments object out in XML.
public void emitXMLFooter()
Emit the XML footer.
public void emitXMLHeader(String filename)
Emit the XML header.
public static String getComment(
Comments comments, String id)
Return the comment associated with the given id in the Comment object.
If there is no such comment, return the placeHolderText.
public static boolean isMinimizedTag(String tag)
Return true if the given HTML tag has no separate end element.
If you want to be able to use sloppy HTML in your comments, then you can
add the element, e.g. li back into the condition here. However, if you
then become more careful and do provide the closing tag, the output is
generally just the closing tag, which is incorrect.
tag.equalsIgnoreCase("tr") || // Is sometimes minimized
tag.equalsIgnoreCase("th") || // Is sometimes minimized
tag.equalsIgnoreCase("td") || // Is sometimes minimized
tag.equalsIgnoreCase("dt") || // Is sometimes minimized
tag.equalsIgnoreCase("dd") || // Is sometimes minimized
tag.equalsIgnoreCase("img") || // Is sometimes minimized
tag.equalsIgnoreCase("code") || // Is sometimes minimized (error)
tag.equalsIgnoreCase("font") || // Is sometimes minimized (error)
tag.equalsIgnoreCase("ul") || // Is sometimes minimized
tag.equalsIgnoreCase("ol") || // Is sometimes minimized
tag.equalsIgnoreCase("li") // Is sometimes minimized
Emit messages about which comments are now unused and which are new.
public static
Comments readFile(String filename)
Read the file where the XML for comments about the changes between
the old API and new API is stored and create a Comments object for
it. The Comments object may be null if no file exists.
public static boolean writeFile(String outputFileName,
Comments newComments)
Write the XML representation of comments to a file.
Parameters: outputFileName The name of the comments file. oldComments The old comments on the changed APIs. newComments The new comments on the changed APIs.
Returns: true if no problems encountered
public static void writeXSD(String filename)
Write the XML Schema file used for validation.