Class HiLiteDividers


  • public class HiLiteDividers
    extends java.lang.Object
    Process Java Doc Web-Page: Syntax HiLiting for In-Line Comment Source-Code.

    JD-Upgrader Internally Used Class, Methods are Package-Private

    There is largely no use for these methods outside of the Java Doc Upgrader Application. Little Java-Doc Style Documentation will be provided here. The code itself (and code comments) may be viewed using the HiLited Source Code Button in the Navigation-Bar, or the URL-Link that is lower on this page.

    To see how this Upgrader Application class works, click the HiLited Source Code Link above.

    This class is designed to make improvements to the output generated by Java's "JavaDoc" program. Since using this package readily incorporates HTML pages into vectors, changing them, modifying them and improving them become easy. One feature that is easily implemented is adding code-hilighting to javadoc output files. Also, cleaning up some of the badly formatted HTML that Java-Doc will generate if the HTML used in comments is excessive also is very easy.

    The following table will present a list of options that are available for adding Hilited Code-Snippets to Java-Documentation HTML Files. The means by which a programmer can insert code snippets into the JavaDoc Code-Documentation Part of a Java Source File is as follows:

    HTML-DIV Class-NameRationale
    COMPLETE The HTML <DIV> element contains the complete method body of your java method. codeParameter 'java' will be sent to HiLite.Me server to hilite the code in this code-documentation portion.
    EXAMPLE The <DIV> element contains java-code that serves as an example in your documentation. codeParameter 'java' will be sent to HiLite.Me server to hilite the code in this code-documentation portion.
    METHODSIGNATURE The <DIV> element you have provided java-doc is the signature of one of your java methods, but doesn't include the method body. codeParameter 'java' will be sent to HiLite.Me server to hilite the code in this code-documentation portion.
    SNIP The <DIV> element is expected to contain a "sub-section" of java-code, not a complete method body. codeParameter 'java' will be sent to the server to hilite the code in this code-documentation portion.
    HTML This <DIV> element contains HTML code, and is intended to be seen as "escaped HTML" rather than "rendered HTML." codeParameter 'HTML' will be sent to the server when this code is hilited.
    JAVASCRIPT The <DIV> element contains "java-script" code. It should be viewed as hilited java-script. codeParameter 'js' will be used with the server. It may be an entire function definition, or merely a few lines, all are considered OK when using this class-name with a <DIV> in your documentation.
    LOC The <DIV> element will contain a single line of Java-Code. codeParameter 'java' will be used with the server.
    SHELL The <DIV> element will contain a single line of UNIX or MS-DOS shell code. The <DIV> contents will not be hilited, and the server will not be queried. Instead, a CSS-Style element will be inserted into the <DIV> that lightens the text, and darkens the background.
    SHELLBLOCK The <DIV> element will contain multiple lines of UNIX or MS-DOS shell code. The <DIV> contents will not be hilited, and the server will not be queried. Instead, a CSS-Style element will be inserted into the <DIV> that lightens the text, and darkens the background.
    REGEX The <DIV> element will contain Regular-Expression Data. It will be hilited. The <DIV> contents will not be hilited by the server - which will not be queried. Instead, a CSS-Style element will be inserted into the <DIV> that lightens the text, and darkens the background.
    JSON The <DIV> element will contain JSON Data
    CSS The <DIV> element will contain CSS Data
    XML The <DIV> element will contain XML Data
    SQL The <DIV> element will contain SQL Data
    OUTPUT The <DIV> element will contain Terminal Output


    NOTE: Any of the above options may include the sub-string '-SCROLL' in the class-name, and when this occurs, the HTML divider element that is inserted to encapsulate the code snippet, method, expression or LOC will have a Cascading-Style-Sheet property inserted into the <DIV STYLE="..."> style-attribute of the HTML divider element to ensure that the code-block does not expand past "20em" and that scroll-bars are properly included in the viewing area of the divider, if needed.



    EXAMPLE: Below is an example use of the HTML 'class=' tags defined above. This "EXAMPLE" uses the class='EXAMPLE' tag, in fact. Make sure to scroll to the bottom to see the entire definition.

    
    /**
     * Creates a {@code TagNode}, an inherited class of {@code 'HTMLNode'} that can be used as an 
     * element of an HTML {@code Vector}.
     *
     * <BR /><BR /><B>NOTE:</B> Attribute values are neither parsed, nor checked when this
     * constructor is used.  This constructor could allow malformed HTML to be passed to the
     * {@code public final String str} field!
     * 
     * <DIV CLASS="EXAMPLE">{@code
     * TagNode tn = new TagNode("<DIV CLASS='SUMMARY' onmouseover=\"alert('Hello!');\">");
     * System.out.println(tn.str);
     * 
     * // Prints to Terminal: <DIV CLASS='SUMMARY' onmouseover="alert('Hello!');">
     * }</DIV>
     *
     * @param s Any valid HTML tag, for instance: {@code <H1>, <A HREF="somoe url">,
     * <DIV ID="some id">} etc...
     * 
     * @throws MalformedTagNodeException If the passed {@code String} wasn't valid - meaning <I>it
     * did not match the regular-expression {@code parser}.</I> 
     * 
     * @throws HTMLTokException If the {@code String} found where the usual HTML token-element is
     * situated <I>is not a valid HTML element</I> then the {@code HTMLTokException} will be
     * thrown.
     * 
     * @see HTMLTags#getTag_MEM_HEAP_CHECKOUT_COPY(String)
     */
    public TagNode(String s)
    {
        super(s);
    
        // If the second character of the string is a forward-slash, this must be a closing-element
        // For Example: </SPAN>, </DIV>, </A>, etc...
    
        isClosing = s.charAt(1) == '/';
    
        // This is the Element & Attribute Matcher used by the RegEx Parser.  If this Matcher doesn't
        // find a match, the parameter 's' cannot be a valid HTML Element.  NOTE: The results of this
        // matcher are also used to retrieve attribute-values, but here below, its results are ignored.
    
        Matcher m = HTMLRegEx.P1.matcher(s);
        ...
    }
    

    OUTPUT TO JAVADOC: The code above demonstrates how to include HTML divider elements into your Java-Doc Code Segments. These divider class attributes are listed in the next table. Sample code-snippets are hilited and then inserted into your class source-files, as per example above. The original JavaDoc program generated HTML files will are updated, not replaced.

    Example
Stateless Class: This class neither contains any program-state, nor can it be instantiated. The @StaticFunctional Annotation may also be called 'The Spaghetti Report'. Static-Functional classes are, essentially, C-Styled Files, without any constructors or non-static member field. It is very similar to the Java-Bean @Stateless Annotation.
  • 1 Constructor(s), 1 declared private, zero-argument constructor
  • 4 Method(s), 4 declared static
  • 9 Field(s), 9 declared static, 8 declared final
  • Fields excused from final modifier (with explanation):
    Field 'firstIteration' is not final. Reason: LOGGING


    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait