Annotation Type StaticFunctional


  • @Retention(SOURCE)
    @Target(TYPE)
    public @interface StaticFunctional
    Java-Annotation: A Java-Annotation for marking classes as 'Stateless Classes' - used to insert 'The Spaghetti Report' into Java Doc Pages.

    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'


    • Element Detail

      • Excused

        🡇     🗕  🗗  🗖
        java.lang.String[] Excused
        This must contain the names of fields in this class or interface that have been declared static, but have not been declared final.

        The values in the 'Excused' array must be parallel to the values in the 'Excuses' array.
        Default:
        {}
        Code:
        Exact Element Declaration:
         String[] Excused() default