Package Torello.JavaDoc.Annotations
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@StaticFunnctionalAnnotation 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 classSFProcessorat compile time for any class that utilizes the annotation. Note that the Java HTML Jar Library, which contains aMETA-INFdirectory that specifies the location of this Annotation Processor, must be in theCLASSPATHat 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@StaticFunctionalAnnotation is to be employed, those fields must be explicitly 'excused' from'The Spaghetti Report'
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/Annotations/StaticFunctional.java
- Open New Browser-Tab: Torello/JavaDoc/Annotations/StaticFunctional.java
File Size: 4,431 Bytes Line Count: 123 '\n' Characters Found
- There must be exactly one constructor. It must be declared using the
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element String[]ExcusedStaticFunctional.Excuse[]Excuses
-
-
-
Element Detail
-
Excused
java.lang.String[] Excused
This must contain the names of fields in thisclassorinterfacethat have been declaredstatic, but have not been declaredfinal.The values in the'Excused'array must be parallel to the values in the'Excuses'array.- Default:
- {}
- Code:
- Exact Element Declaration:
String[] Excused() default
-
-
-
Excuses
StaticFunctional.Excuse[] Excuses
This must contain instances of the Enumerated-Type'Excuses'. These excuses should explain the reason why the named field has not been declared'final'in anyclassorinterfacethat has been marked with the@StaticFunctionannotation.The values in the'Excuses'array must be parallel to the values in the'Excused'array.- Default:
- {}
- Code:
- Exact Element Declaration:
Excuse[] Excuses() default
-
-