public class API
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
API()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
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.