|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjdiff.API
public class API
The internal representation of an API. RootDoc could have been used for representing this, but you cannot serialize a RootDoc object - see http://developer.java.sun.com/developer/bugParade/bugs/4125581.html You might be able use Javadoc.Main() to create another RootDoc, but the methods are package private. You can run javadoc in J2SE1.4, see: http://java.sun.com/j2se/1.4/docs/tooldocs/javadoc/standard-doclet.html#runningprogrammatically but you still can't get the RootDoc object. The advantage of writing out an XML representation of each API is that later runs of JDiff don't have to have Javadoc scan all the files again, a possibly lengthy process. XML also permits other source code in languages other than Java to be scanned to produce XML, and then versions of JDiff can be used to create documents describing the difference in those APIs. See the file LICENSE.txt for copyright details.
Field Summary | |
---|---|
java.util.Hashtable |
classes_
The list of all the classes. |
jdiff.ClassAPI |
currClass_
The current class being added to during parsing. |
jdiff.ConstructorAPI |
currCtor_
The current constructor being added to during parsing. |
jdiff.FieldAPI |
currField_
The current field being added to during parsing. |
jdiff.MethodAPI |
currMethod_
The current method being added to during parsing. |
jdiff.PackageAPI |
currPkg_
The current package being added to during parsing. |
static int |
indentInc
Amount by which to increment each indentation. |
java.lang.String |
name_
The String which identifies this API, e.g. |
java.util.List |
packages_
The list of all the top-level packages. |
Constructor Summary | |
---|---|
API()
Default constructor. |
Method Summary | |
---|---|
static java.lang.String |
convertHTMLTagsToXHTML(java.lang.String htmlText)
NOT USED. |
void |
dump()
Display the contents of the API object. |
static void |
dumpClass(jdiff.ClassAPI c,
int indent)
Display the contents of a ClassAPI object. |
static void |
dumpCtor(jdiff.ConstructorAPI c,
int indent)
Display the contents of a constructor. |
static void |
dumpField(jdiff.FieldAPI f,
int indent)
Display the contents of a field. |
static void |
dumpMethod(jdiff.MethodAPI m,
int indent)
Display the contents of a MethodAPI object. |
static void |
dumpModifiers(jdiff.Modifiers m,
int indent)
Display the contents of the Modifiers object. |
void |
dumpPackage(jdiff.PackageAPI pkg,
int indent)
Display the contents of a PackageAPI object. |
static void |
dumpParam(jdiff.ParamAPI p,
int indent)
Display the contents of a parameter. |
static java.lang.String |
hideHTMLTags(java.lang.String htmlText)
Convert all HTML tags to text by stuffing text into the HTML tag to stop it being an HTML or XML tag. |
static java.lang.String |
showHTMLTags(java.lang.String text)
Convert text with stuffed HTML tags ("lEsS_tHaN", etc) into HTML text. |
static java.lang.String |
stuffHTMLTags(java.lang.String htmlText)
Convert all HTML tags to text by placing them inside a CDATA element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.List packages_
public java.util.Hashtable classes_
public java.lang.String name_
public jdiff.PackageAPI currPkg_
public jdiff.ClassAPI currClass_
public jdiff.ConstructorAPI currCtor_
public jdiff.MethodAPI currMethod_
public jdiff.FieldAPI currField_
public static final int indentInc
Constructor Detail |
---|
public API()
Method Detail |
---|
public void dump()
public void dumpPackage(jdiff.PackageAPI pkg, int indent)
pkg
- The given PackageAPI object.indent
- The number of spaces to indent the output.public static void dumpClass(jdiff.ClassAPI c, int indent)
c
- The given ClassAPI object.indent
- The number of spaces to indent the output.public static void dumpModifiers(jdiff.Modifiers m, int indent)
c
- The given Modifiers object.indent
- The number of spaces to indent the output.public static void dumpCtor(jdiff.ConstructorAPI c, int indent)
c
- The given constructor object.indent
- The number of spaces to indent the output.public static void dumpMethod(jdiff.MethodAPI m, int indent)
m
- The given MethodAPI object.indent
- The number of spaces to indent the output.public static void dumpField(jdiff.FieldAPI f, int indent)
f
- The given field object.indent
- The number of spaces to indent the output.public static void dumpParam(jdiff.ParamAPI p, int indent)
p
- The given parameter object.indent
- The number of spaces to indent the output.public static java.lang.String stuffHTMLTags(java.lang.String htmlText)
public static java.lang.String hideHTMLTags(java.lang.String htmlText)
foo
"
becomes "lEsS_tHaNcode>foolEsS_tHaN/code>". Replace all <
characters
with the string "lEsS_tHaN". Also replace & character with the
string "aNd_cHaR" to avoid text entities. Also replace "
character with the
string "qUoTe_cHaR".
public static java.lang.String showHTMLTags(java.lang.String text)
public static java.lang.String convertHTMLTagsToXHTML(java.lang.String htmlText)
with
. Just for the small number of HMTL tags which don't require a matching end tag. Also make HTML conform to the simple HTML requirements such as no double hyphens. Double hyphens are replaced by - and the character entity for a hyphen. Cases where this fails and has to be corrected in the XML by hand: Attributes' values missing their double quotes , e.g. size=-2 Mangled HTML tags e.g. <ttt>NOT USED. There is often too much bad HTML in doc blocks to try to handle every case correctly. Better just to stuff the *lt; and &: characters with stuffHTMLTags(). Though the resulting XML is not as elegant, it does the job with less intervention by the user.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |