Class 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 class Upgrade, and executing its upgrade() 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 class Upgrade, specifically calling:

    Upgrade.setExtraTasks(Consumer<JavaDocHTMLFile> handler)

    ... with a handler (a java.util.function.Consumer instance) that receives a JavaDocHTMLFile instance.

    Class JavaDocHTMLFile 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 the Upgrader, make the necessary improvements, and they will be incorporated into the final-output HTML-Page.

    Again, class JavaDocHTMLFile has getters for: HeaderFooterHTML, SummaryTableHTML and ReflHTML


    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 and HeaderFooterHTML.

    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>


    • Field Detail

      • serialVersionUID

        🡇     🗕  🗗  🗖
        protected static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable 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

        🡅  🡇     🗕  🗗  🗖
        public java.util.Vector<HTMLNodehead()
        Retrieve the HTML <HEAD>.
        Returns:
        An HTML-Vector containing all elements between the opening-<HEAD> and closing-</HEAD> tags. This method shall never return null, nor will it return an empty-Vector
        Code:
        Exact Method Body:
         return this.head.html;
        
      • topNavBar

        🡅  🡇     🗕  🗗  🗖
        public java.util.Vector<HTMLNodetopNavBar()
        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<HTMLNodepackageInfo()
        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

        🡅  🡇     🗕  🗗  🗖
        public java.util.Vector<HTMLNodetitle()
        Retrieve the title of the page, as an HTML-Vector
        Returns:
        An HTML-Vector containing all elements in the title. This method shall never return null, nor will it return an empty-Vector
        Code:
        Exact Method Body:
         return this.title.html;
        
      • inheritance

        🡅  🡇     🗕  🗗  🗖
        public java.util.Vector<HTMLNodeinheritance()
        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 an Interface 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<HTMLNodedefListsAboveSig()
        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<HTMLNodesignature()
        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<HTMLNodedescription()
        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<HTMLNodedefListsBelowDesc()
        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<HTMLNodebottomNavBar()
        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-provided Appendable. 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 an IOException is thrown while writing to this Appendable, it will be caught an wrapped in an IllegalArgumentException, with the IOException set as the cause.
        Throws:
        java.lang.IllegalArgumentException - If 'a' throws an IOException
        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
             );
         }