Annotation Type StaticFunctional
@Retention(SOURCE) @Target(TYPE) public @interface StaticFunctionalJavaDoc Upgrader Annotations:
Both of the Elements -
Excused- are optional.
Excusesaccepts the enum
'Excuse', or an
Excusedwill accept a
Both of the Elements (
EmbedTagFileIDare optional). Both of them accept either a
String, or a
Genuine Java Annotation:
This is the actual annotation that a user may place in a
'.java'file. This annotation may only be placed on a type - and only on a
interface.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 class
SFProcessorat compile time for any class that utilizes the annotation. Note that the Java HTML Jar Library, which contains a
META-INFdirectory that specifies the location of this Annotation Processor, must be in the
CLASSPATHat 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
- All fields inside the class must be declared both
- 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'
The image-capture, below, shows the use of the @StaticFunctional Annotation, including the
final) fields inside this class:
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.
Hi-Lited Source-Code:This File's Source Code:
- View Here: Torello/JavaDoc/StaticFunctional.java
- Open New Browser-Tab: Torello/JavaDoc/StaticFunctional.java
Annotation Processor Class:
- View Here: Torello/JavaDoc/Annotations/SFProcessor.java
- Open New Browser-Tab: Torello/JavaDoc/Annotations/SFProcessor.java
Annotation Mirror Class:
- View Here: Torello/JavaDoc/Annotations/AnnotationsMirror.java
- Open New Browser-Tab: Torello/JavaDoc/Annotations/AnnotationsMirror.java
java.lang.String ExcusedThis must contain the names of fields in this
interfacethat have been declared
static, but have not been declared
NOTE: The values in the
'Excused'array must be parallel to the values in the
ExcusesThis must contain instances of the Enumerated-Type
'Excuses'. These excuses should explain the reason why the named field has not been declared
interfacethat has been marked with the
NOTE: The values in the
'Excuses'array must be parallel to the values in the