Package Torello.JavaDoc
Class HeaderFooterHTML
- java.lang.Object
-
- Torello.JavaDoc.HeaderFooterHTML
-
public class HeaderFooterHTML extends java.lang.Object
Optional-Extension Class of a Basic-Upgrade:
Running a Standard-Upgrade on a Java-Doc Web-Page Directory-Tree only requires building an instance of classUpgrade
, and executing itsupgrade()
method!
The Standard-Upgrade Process will insert CSS-Tags, Hi-Lite Properly-Marked Code-Snippet<DIV>'s
, Hi-Lite all Method-Bodies & Field-Declarations, and even create Navigation-Menu Links. If more fine-grained control is needed, this class provides direct access to the Java Doc Web-Page HTML.
Accessing this Class:
This class may be accessed by utilizing a configuration method in classUpgrade
, specifically calling:
Upgrade.setExtraTasks(Consumer<JavaDocHTMLFile> handler)
... with a handler (ajava.util.function.Consumer
instance) that receives aJavaDocHTMLFile
instance.
ClassJavaDocHTMLFile
provides access to every HTML Component on a Java-Doc Web-Page. If programmatic changes to a Java-Doc Web-Page are needed, these Reflection-API classes make it easy to change, update, remove & add-to the HTML on these pages. Simply registering a handler with theUpgrader
, make the necessary improvements, and they will be incorporated into the final-output HTML-Page.
Again, classJavaDocHTMLFile
has getters for:HeaderFooterHTML
,SummaryTableHTML
andReflHTML
Alternatively:
Creating an instance of one of the two offered "User-Processor" classes - both of which have several listener/handler methods - is also a great way to access the Reflection-HTML API. These two Java Interfaces are:
Encapsulates the HTML placed both the top and the bottom of a JavaDoc Web-Page, including the Navigation-Bar HTML, the Package-Name, Type-Signature and other Banner-Labesl.This Class May be Used to Programmatically Modify JavaDoc HTML
Modifying JavaDoc HTML can be done using:JavaDocHTMLFile
,SummaryTableHTML
,ReflHTML
andHeaderFooterHTML
.
To get instances of these classes, just register a listener with the Upgrader using:Upgrade.setExtraTasks
This is optional, as the Standard Upgrader-Features do not necessitate use of this class.
This class stores all information that is contained above the Summaries-Section of a Java Doc Web-Page; it also contains the Page-Footer Navigation-Bar, if one is present.
The HTML-Items which have been reterieved and exported this class include:- Top Navigation Bar
- Bottom Navigation Bar
- The Java Package containg this CIET/Type, as an HTML-
Vector
- The Title of the Page (Class-Name, Interface-Name, etc...)
- Inheritance-Tree HTML (if present)
- Banner Information (See-Also, Author, etc...)
- The Signature of the Type (an HTML
<PRE>
Element) - The Type's Main-Description
<DIV>
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/HeaderFooterHTML.java
- Open New Browser-Tab: Torello/JavaDoc/HeaderFooterHTML.java
File Size: 28,441 Bytes Line Count: 676 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field protected static long
serialVersionUID
-
Method Summary
HTML Accessor Methods Modifier and Type Method Vector<HTMLNode>
bottomNavBar()
Vector<HTMLNode>
defListsAboveSig()
Vector<HTMLNode>
defListsBelowDesc()
Vector<HTMLNode>
description()
Vector<HTMLNode>
head()
Vector<HTMLNode>
inheritance()
Vector<HTMLNode>
packageInfo()
Vector<HTMLNode>
signature()
Vector<HTMLNode>
title()
Vector<HTMLNode>
topNavBar()
Quick Debugging Printer Modifier and Type Method void
debugPrint(Appendable a)
-
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final long serialVersionUID = 1;
-
-
Method Detail
-
head
-
topNavBar
public java.util.Vector<HTMLNode> topNavBar()
Retrieve the Navigation-Bar HTML at the top of a Java Doc Page.- Returns:
- An HTML-
Vector
containing all elements in the Top Navigation-Bar. If there is no Navigation-Bar at the top, then this method shall return null. - Code:
- Exact Method Body:
return (this.topNavBar != null) ? this.topNavBar.html : null;
-
packageInfo
public java.util.Vector<HTMLNode> packageInfo()
Retrieve the Type's Package-Information, as an HTML-Vector
.- Returns:
- An HTML-
Vector
containing all elements in the package label at the top of a Java-Doc Page. This method shall never return null, nor will it return an empty-Vector
- Code:
- Exact Method Body:
return this.packageInfo.html;
-
title
-
inheritance
public java.util.Vector<HTMLNode> inheritance()
Get the HTML for the Type's inheritance<UL>'s
-List.- Returns:
- An HTML-
Vector
containing all elements in the Type Inheritance List. If the Type is anInterface
that does not have any inheriting-types, or an@Annotation
, then this method shall return null. - Code:
- Exact Method Body:
return (this.inheritance != null) ? this.inheritance.html : null;
-
defListsAboveSig
public java.util.Vector<HTMLNode> defListsAboveSig()
Get any Definition-Lists that occur above the Type's Signature, which is at the top.- Returns:
- An HTML-
Vector
containing all elements in the definition<DL>
lists below the Yellow-Box Description. This method shall never return null. If there are no such lists, then an empty HTML-Vector
is returned.
It is perfectly acceptable to add HTML-Content to an empty-list. Here, it would place such content directly above the Type-Signature<PRE>
box that is located at the top of the page. - Code:
- Exact Method Body:
return this.defListsAboveSig.currentNodes();
-
signature
public java.util.Vector<HTMLNode> signature()
Retrieve the signature HTML from the top of the page.- Returns:
- An HTML-
Vector
containing all elements in the Type-Signature<PRE>
Element. This is located at the top of the class, and is box with a shadow border. This method shall never return null, nor will it return an empty-Vector
- Code:
- Exact Method Body:
return this.signature.html;
-
description
public java.util.Vector<HTMLNode> description()
Retrieve the description from the top of the page, as HTML.- Returns:
- An HTML-
Vector
containing all elements in the description, which is a Yellow box at the top of the page. This method shall never return null. If there is no such HTML divider, then an empty HTML-Vector
is returned.
It is perfectly acceptable to add HTML-Content to an empty-list. Here, it would place such content directly below the Yellow-Description box that is located at the top of the page. - Code:
- Exact Method Body:
return this.description.currentNodes();
-
defListsBelowDesc
public java.util.Vector<HTMLNode> defListsBelowDesc()
Get any Definition-Lists that occur below the Yellow-Box Signature.- Returns:
- An HTML-
Vector
containing all elements in the definition<DL>
lists below the Yellow-Box Description. This method shall never return null. If there are no such lists, then an empty HTML-Vector
is returned.
It is perfectly acceptable to add HTML-Content to an empty-list. Here, it would place such content directly below the Yellow-Description box that is located at the top of the page. - Code:
- Exact Method Body:
return this.defListsBelowDesc.currentNodes();
-
bottomNavBar
public java.util.Vector<HTMLNode> bottomNavBar()
Retrieve the Navigation-Bar HTML at the bottom of a Java Doc Page.- Returns:
- An HTML-
Vector
containing all elements in the Bottom Navigation-Bar. If there is no Navigation-Bar at the top, then this method shall return null. - Code:
- Exact Method Body:
return (this.bottomNavBar != null) ? this.bottomNavBar.html : null;
-
debugPrint
public void debugPrint(java.lang.Appendable a)
Prints an abbreviated-version of the contents of this instance, to a user-providedAppendable
. If the HTML requires more than four lines of text, only the first four lines are printed.- Parameters:
a
- This may be any Java Appendable. If anIOException
is thrown while writing to thisAppendable
, it will be caught an wrapped in anIllegalArgumentException
, with theIOException
set as thecause
.- Throws:
java.lang.IllegalArgumentException
- If'a'
throws anIOException
- See Also:
StrPrint.firstNLines(String, int)
,Util.pageToString(Vector)
- Code:
- Exact Method Body:
try { a.append( STARS + BCYAN + "this.head" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(head.html), 4) + '\n' ); if (topNavBar != null) a.append( STARS + BCYAN + "this.topNavBar" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(topNavBar.html), 4) + '\n' ); else a.append(STARS + BRED + "this.topNavBar is null" + RESET + STARS); a.append( STARS + BCYAN + "this.packageInfo" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(packageInfo.html), 4) + '\n' ); a.append( STARS + BCYAN + "this.title" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(title.html), 4) + '\n' ); if (inheritance != null) a.append( STARS + BCYAN + "this.inheritance" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(inheritance.html), 4) + '\n' ); else a.append(STARS + BRED + "this.inheritance is null" + RESET + STARS); if (defListsAboveSig.currentSize() > 0) a.append( STARS + BCYAN + "this.defListsAboveSig" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(defListsAboveSig.currentNodes()), 4) + '\n' ); else a.append(STARS + BRED + "this.defListsAboveSig is empty" + RESET + STARS); a.append( STARS + BCYAN + "this.signature" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(signature.html), 4) + '\n' ); if (description.currentSize() > 0) a.append( STARS + BCYAN + "this.description" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(description.currentNodes()), 4) + '\n' ); else a.append(STARS + BRED + "this.description is empty" + RESET + STARS); if (defListsBelowDesc.currentSize() > 0) a.append( STARS + BCYAN + "this.defListsBelowDesc" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(defListsBelowDesc.currentNodes()), 4) + '\n' ); else a.append(STARS + BRED + "this.defListsBelowDesc is empty" + RESET + STARS); if (bottomNavBar != null) a.append( STARS + BCYAN + "this.bottomNavBar" + RESET + ':' + STARS + StrPrint.firstNLines(Util.pageToString(bottomNavBar.html), 4) + '\n' ); else a.append(STARS + BRED + "this.bottomNavBar is null" + RESET + STARS); } catch (java.io.IOException ioe) { throw new IllegalArgumentException( "Your Appendable instance has caused an IOException to throw. See getCause() " + "for details", ioe ); }
-
-