Class StatelessClasses


  • public class StatelessClasses
    extends java.lang.Object
    Process Java Doc Web-Page: Makes use of the Java HTML Library StaticFunctional Annotation to insert a Spaghetti Report™ into the web-pages for classes that were annotated with it.

    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, please review the source.

    If a class has been annotated with the @StaticFunctional Annotation, then when the JavaDoc Upgrader is invoked, a 'Spaghetti Report' Summary is inserted into the Documentation Page for that class. This report can be viewed on nearly all of the classes in the Java-HTML Library. The @StaticFunctional Annotation may only be placed on classes, and isn't a RunTime, but rather, merely, a Source Annotation.



    This is a marker used in Java-HTML to identify classes that do not maintain any state. Likely three out of every four classes in the Java-HTML Library are annotated with this annotation.

    The purpose of the @StaticFunnctional Annotation is to provide some amount of confidence that unexplained state-ful behavior is not occuring in the background of a class or interface. Although there are likely numerous definitions for the concept of 'Stateful Behavior', here it is used to imply that for any given set of inputs to a function, the returned-result of the function shall always be identical. Object-Oriented programming is an invaluable tool in a programmer's repertoire, but for most library and utility packages, functional programming that does not contain any 'Porgram State' is usually much easier to analyze and understand.

    The rules for the @StaticFunctional Annotation are listed, here, below. These rules are checked by the class SFProcessor at compile time for any class that utilizes the annotation. Note that the Java HTML Jar Library, which contains a META-INF directory that specifies the location of this Annotation Processor, must be in the CLASSPATH at the time of compilation in order for this checker to operate successfully.

    • There must be exactly one constructor. It must be declared using the 'private' modifier, and it must accept precisely zero arguments.
    • All methods offered by the class must use the 'static' modifier.
    • All fields inside the class must be declared both 'static' and 'final'
    • In some situations pertaining to simple or basic configurations, debugging and logging a field may be declared 'static', but not include the 'final' modifier. In such situations, if the @StaticFunctional Annotation is to be employed, those fields must be explicitly 'excused' from 'The Spaghetti Report'


    The image-capture, below, shows the use of the @StaticFunctional Annotation, including the 'Excused' (non-final) fields inside this class:

    Example @StaticFunctional Use

    When classes are annotated, as in the image-example above, the JavaDoc Upgrader Tool will insert a summary report on the stateful-ness of the class that resembles the image-capture below (if the user does, indeed, invoke the JavaDoc Upgrader). The Annotation, by iteself, will not be used by the original 'javadoc' Utility, the Upgrader must be used to get the report, below, included into the output documentation pages.

    StatelessClass 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
    • 1 Method(s), 1 declared static
    • 1 Field(s), 1 declared static, 1 declared final


    • Field Summary

      Fields 
      Modifier and Type Field
      protected static String DIV_HEADER
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DIV_HEADER

         
        protected static final java.lang.String DIV_HEADER
        This is the notice that is inserted into classes that have been targeted by the StaticFunctional annotation.
        See Also:
        Constant Field Values
        Code:
        Exact Field Declaration Expression:
         protected static final String DIV_HEADER =
                 "\n" +
                 "<BR />\n" +
                 "<DIV ID=STATELESSCLASS>\n" +
                 "<SPAN CLASS=staticFunctional>Stateless Class:</SPAN>\n" +
                 "<DIV CLASS=JDTopIndent>\n" +
                 "This class neither contains any program-state, nor can it be instantiated.  The " +
                 "<CODE>@StaticFunctional</CODE> Annotation may also be called 'The Spaghetti Report'.\n" +
                 "<CODE>Static-Functional</CODE> classes are, essentially, C-Styled Files, " +
                 "without any <I>constructors</I> or <I>non-static member field</I>.  It is very similar " +
                 "to the Java-Bean <CODE>@Stateless</CODE> Annotation.<BR />\n\n" +
                 "<UL CLASS=JDUL>\n";