public class HiLiteMethods extends java.lang.Object
HiLiteMethods - Documentation.
The primary use of this class is that it allows a user to request that the Java-Doc assistance package hilite each and every method within an (already existing) Java-Doc HTML Class, Enumerated-Type, or Interface Page.
NOTE: This class will only provide Method Bodies as Hilited Code, Constructors and Fields will not be hilited.
Static (Functional) API: The methods in this class are all
(100%)defined with the Java Key-Word / Key-Concept
'static'. Furthermore, there is no way to obtain an instance of this class, because there are no
private) constructors. Java's Spring-Boot, MVC feature is *not* utilized because it flies directly in the face of the light-weight data-classes philosophy. This has many advantages over the rather ornate Component Annotations (
@Component, @Service, @AutoWired, etc... 'Java Beans') syntax:
- The methods here use the key-word
'static'which means (by implication) that there is no internal-state. Without any 'internal state' there is no need for constructors in the first place! (This is often the complaint by MVC Programmers).
'Static'(Functional-Programming) API expects to use fewer data-classes, and light-weight data-classes, making it easier to understand and to program.
Vectorized HTMLdata-model allows more user-control over HTML parse, search, update & scrape. Also, memory management, memory leakage, and the Java Garbage Collector ought to be intelligible through the 'reuse' of the standard JDK
class Vectorfor storing HTML Web-Page data.
The power that
object-oriented programmingextends to a user is (mostly) limited to data-representation. Thinking of "Services" as "Objects" (Spring-MVC, 'Java Beans') is somewhat 'over-applying' the
Object OrientedProgramming Model. Like most classes in the
Java-HTML JAR Library, this class backtracks to a more C-Styled
Functional Programming Model(no Objects) - by re-using (quite profusely) the key-word
staticwith all of its methods, and by sticking to Java's well-understood
Static Fields: The methods in this class do not create any internal state that is maintained - however there are a few
private & staticfields defined. These fields are instantiated only once during the
Class Loaderphase (and only if this class shall be used), and serve as
data 'lookup'fields (static constants). View this class' source-code in the link provided below to see internally used data.
The two internally-defined
private, staticfields defined in this class include an
HTMLNodearray array which is used as the header for hilited method definitions, and a
Stringconstant identifying the chosen HiLiter Style.
- The methods here use the key-word
All Methods Static Methods Concrete Methods Modifier and Type Method
run(Vector<HTMLNode> fileVec, JavaSourceCodeFile jscf, JavaDocHTMLFile jdhf, String jdFileName, String srcCodeFileName, HiLiter hiLiter, StorageWriter sw)
public static int run(java.util.Vector<HTMLNode> fileVec, JavaSourceCodeFile jscf, JavaDocHTMLFile jdhf, java.lang.String jdFileName, java.lang.String srcCodeFileName, HiLiter hiLiter, StorageWriter sw)This method will hilite all
Method'sthat are scraped from a Java Doc Generated HTML Documentation Page for a Class, Enumerated Type, or Interface. Hilited source-code for method-bodies (as
String's) are inserted into the Java-Doc HTML Web-Page in the
'Method Details'section for any / all
Method'sfound on the page.
fileVec- This is the local file-name that contains the HTML-Page JavaDoc File, stored as a vectorized-html web-page.
jscf- This is the parsed "Source-Code-File" created by the Java-Parser Bridge. This allows the logic to retrieve the actual text-
Stringdata-definitions for the
Method-bodies in a Java-Class. After identifying the correct
Method, these text-
String'scan be transmitted to the
HiLite Serverand added into the Java-Doc Page.
jdhf- This is the parsed "Java-Doc HTML Web Documentation File" which was also parsed by the Java-Parser bridge. Theoretically, it should contain identical (or nearly identical) internals (
Field's, Constructor's, and
Method's) to the instance of "JavaSourceCodeFile" (input parameter
'jscf') - because they are both created from the same Java class.
jdFileName- This parameter is not needed for the purposes of loading the file here. In this method this parameter is required to make sure that if an exception is thrown, the name of the java-doc file being updated is included in exception / error messages that are potentially thrown.
srcCodeFileName- This is the local file-name that contains the "Java Source Code File" as a
Functional Interfacemodule that performs Code Hiliting.
sw- This parameter is a log, and if it is not
null, it will print log information. If it is
null, it will be ignored.
- This will return a count on exactly how many
Method'shave had their code-hilited
Method-bodies inserted into the JavaDoc Documentation File for this class.
- Exact Method Body: