Class Config


  • public final class Config
    extends java.lang.Object
    This class provides a list of fields, all of which may be modified and configured, for providing any needed settings to class Builder.

    Use the public constructor offered by this class, and then set and change the values of any of the Configuration-Fields. Once this class Configuration-Fields have been appropriately set to contain your project's data, pass the instance to the Builder class only constructor (along with an argv String[]-Array).

    This will inform the Builder-Constructor of all of your nedded settings, and once built, will make running your project's build script very easy.


    • Field Detail

      • projectNameValidator

        🡇     🗕  🗗  🗖
        public static final java.util.function.Predicate<java.lang.String> projectNameValidator
        Project-Name validation String. The value passed to configuration field/parameter must match this regular expression. This is used in this class validate() method.
        See Also:
        PROJECT_NAME, Builder.PROJECT_NAME, validate()
        Code:
        Exact Field Declaration Expression:
         public static final Predicate<String> projectNameValidator =
                 Pattern.compile("^\\w[\\w\\d]*$").asPredicate();
        
      • LOCAL_JAVADOC_DIR

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String LOCAL_JAVADOC_DIR
        The File-System Directory-Location where Java-Doc Output is sent for storage. Also the directory that the Upgrader searches to retrieve and parse JavaDoc Files.
        See Also:
        Builder.LOCAL_JAVADOC_DIR
        Code:
        Exact Field Declaration Expression:
         public String LOCAL_JAVADOC_DIR = "javadoc" + java.io.File.separator;
        
      • JAVAC_BIN

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String JAVAC_BIN
        The full or partial Path-Name of the 'javac' binary to use for compiling this project. This parameter / field may not be null, or a NullPointerException will throw.

        Default Setting:
        The default setting for this Configuration-Field is just the command name, which is to presume that the PATH environment-variable has been set to facilitate finding 'javac'
        See Also:
        Builder.JAVAC_BIN
        Code:
        Exact Field Declaration Expression:
         public String JAVAC_BIN = "javac";
        
      • JAVADOC_BIN

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String JAVADOC_BIN
        The full or partial Path-Name of the 'javac' binary to use for compiling this project. This parameter / field may not be null, or a NullPointerException will throw.

        Default Setting:
        The default setting for this Configuration-Field is just the command name, which is to presume that the PATH environment-variable has been set to facilitate finding 'javadoc'.
        See Also:
        Builder.JAVADOC_BIN
        Code:
        Exact Field Declaration Expression:
         public String JAVADOC_BIN = "javadoc";
        
      • FAVICON

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String FAVICON
        If the Stage 3 Upgrade-Process utilizes a favicon on its Web-Pages, then this field may be assigned to the location on disk where that favicon is located.

        When this field contains a non-null Image-File, that image will be copied (after upgrade has completed) directly to the 'javadoc' output directory. When this field is left null, it will be ignored and no favicon image is copied.
        See Also:
        Builder.FAVICON
        Code:
        Exact Field Declaration Expression:
         public String FAVICON = null;
        
      • GCS_DIR_DEV

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String GCS_DIR_DEV
        The Google Cloud Platform Storage-Bucket into which jar, log & documentation files will be copied by this Build-Tool. This Storage-Bucket Directory is intended for use with a boiler-plate & "still under development" URL.

        If this parameter remains null, several of the user menu options will be removed, because several are designed for coying data to the Developer Site. When it is null such options are removed, and this Configuration-Field is ignored.
        See Also:
        Builder.GCS_DIR_DEV, GCS_DIR_RELEASE, Builder.GCS_DIR_RELEASE
        Code:
        Exact Field Declaration Expression:
         public String GCS_DIR_DEV = null;
        
      • GCS_DIR_RELEASE

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String GCS_DIR_RELEASE
        Another Google Cloud Platform Storage-Bucket for storing and providing jar, log & Code-Documentation Files.

        Similary to Configuration-Field GCS_DIR_DEV, this parameter may also be null, and when it is it will be ignored, but a few User-Interface Menu-Options will not be present at the Build-Menu.
        See Also:
        Builder.GCS_DIR_RELEASE, GCS_DIR_DEV, Builder.GCS_DIR_DEV
        Code:
        Exact Field Declaration Expression:
         public String GCS_DIR_RELEASE = null;
        
      • BACKUP_TAR_FILE_GCS_DIR

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String BACKUP_TAR_FILE_GCS_DIR
        A Storage-Bucket on Google Cloud Platform for saving the generated backup '.tar' File. This Configuration-Field may remain null, and if it is it will be silently ignored. In this case, the generated backup '.tar' File will not be copied onto any Google Cloud Platform Storage-Buckets.
        See Also:
        Builder.BACKUP_TAR_FILE_GCS_DIR
        Code:
        Exact Field Declaration Expression:
         public String BACKUP_TAR_FILE_GCS_DIR = null;
        
      • JAR_FILE_MOVE_DIR

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String JAR_FILE_MOVE_DIR
        This optional configuration field is optional, and may be used to move / relocate the '.jar' File after it's built by this Build-Processor. If there is a diretory or location on the File-System into which the '.jar' should be moved, then provide that directory's name here.

        When this field is left null, it will be silently ignored; furthermore, the '.jar' File which the Build-Processor creates will be left in the Current Working Directory.
      • LOG_DIR

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String LOG_DIR
        The directory location where log information will be saved. This configuration field may not be null, or a NullPointerException will throw.
      • extraSwitchesJAVAC

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String[] extraSwitchesJAVAC
        For Stage 1, the Java-Compiler Stage, this Configuration-Field may be assigned any switch-String's, and they will be passed to the javac invocation.

        This field's value may be left null, or assigned a zero-length String[]-Array and, in both cases, it shall be ignored.
        See Also:
        Builder.extraSwitchesJAVAC
        Code:
        Exact Field Declaration Expression:
         public String[] extraSwitchesJAVAC = null;
        
      • extraSwitchesJAVADOC

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String[] extraSwitchesJAVADOC
        For Stage 2, the javadoc Stage, this Configuration-Field may be assigned any switch-String's, and they will be passed to the javadoc invocation.

        This field's value may be left or null, or assigned a zero-length String[]-Array, and, in both cases, it shall be ignored.
        See Also:
        Builder.extraSwitchesJAVADOC
        Code:
        Exact Field Declaration Expression:
         public String[] extraSwitchesJAVADOC = null;
        
      • CLASS_PATH

        🡅  🡇     🗕  🗗  🗖
        public java.lang.String[] CLASS_PATH
        The Root Class-File Directories to use with 'javac'. This is used to generate the value passed to the -cp switch passed when Stage 1 invokes the Java-Compiler. This parameter / field may be empty or null, and if it is, it will be ignored.
      • jarIncludes

        🡅  🡇     🗕  🗗  🗖
        public JarInclude jarIncludes
        This allows for specifying a list of files to manually add into the '.jar' that is built by this package.

        Constructor Call:
        Because it isn't necessary to include any "Extra Files" into the '.jar', there is some likelihood that this Configuration-Field wouldn't ever be needed / used. Make sure to call the JarInclude constructor, first, to build an instance of this Config-Field before attempting to use it. Notice that it is initially initialized to null!

        Common Usess:
        Java-HTML has quite a few Data-Files that are inserted into the Jar-File, manually, using this class. There may also be the need to insert META-INF/ directory files that name things like Annotation-Processor locations, taglets, or other Java Services.
        See Also:
        Builder.jarIncludes
        Code:
        Exact Field Declaration Expression:
         public JarInclude jarIncludes = null;
        
      • NO_JAVADOC_FRAMES_SWITCH

        🡅  🡇     🗕  🗗  🗖
        public boolean NO_JAVADOC_FRAMES_SWITCH
        JavaDoc Frames were a true majesty that should never have been eliminated. If you would prefer to remove them, or you are using JDK 21+ which no longer accepts the --frames switch, then set this Configuration-Field to FALSE.
        See Also:
        Builder.NO_JAVADOC_FRAMES_SWITCH
        Code:
        Exact Field Declaration Expression:
         public boolean NO_JAVADOC_FRAMES_SWITCH = false;
        
    • Constructor Detail

      • Config

        🡅  🡇     🗕  🗗  🗖
        public Config()
        Creates an instance of this class, with all default values assigned to the parameter / fields.

        The intention is that an instance of this class will have its Configuration-Fields property assigned, according to the needs of the Project being built. Afterwards, the 'Config' instance may be passed to the 'Builder'-Constructor and then that instance may be used to build the project.
        See Also:
        Builder(Config, String...), Builder.build()
    • Method Detail

      • validate

        🡅     🗕  🗗  🗖
        public final void validate()
                            throws java.io.FileNotFoundException
        Used by class Builder to validate all user-provided data on a best efforts basis.
        Throws:
        java.lang.NullPointerException - If any of the configuration parameter/fields listed here have been assigned null

        This exception will also be thrown if these lists contain any null-valued entries:
        java.lang.IllegalArgumentException - If any of these configuration fields were assigned a negative number:

        This exception will also be thrown if:
        java.io.FileNotFoundException - This exception will throw if either of these fields are not assigned a valid File-System Directory-Name:
        UnrecognizedImageExtException - If the FAVICON Image-Format cannot be properly "guessed" by class IF.
        EmptyListException - If packageList has been assigned an empty list.
        WriteableDirectoryException - If parameter JAR_FILE_MOVE_DIR is assigned a non-null value, but the String assigned it does not point to a File-System directory, or that directory is not writeable.

        Also throws if LOG_DIR is not a valid directory-name, that allows write-access.
        Code:
        Exact Method Body:
         Objects.requireNonNull(LOCAL_JAVADOC_DIR,   M1 + "LOCAL_JAVADOC_DIR" + M2);
         Objects.requireNonNull(PROJECT_NAME,        M1 + "PROJECT_NAME" + M2);
         Objects.requireNonNull(JAVAC_BIN,           M1 + "JAVAC_BIN" + M2);
         Objects.requireNonNull(JAVADOC_BIN,         M1 + "JAVADOC_BIN" + M2);
         Objects.requireNonNull(TAR_SOURCE_DIR,      M1 + "TAR_SOURCE_DIR" + M2);
         Objects.requireNonNull(LOG_DIR,             M1 + "LOG_DIR" + M2);
         Objects.requireNonNull(upgrader,            M1 + "upgrader" + M2);
         Objects.requireNonNull(packageList,         M1 + "packageList" + M2);
        
         if (! projectNameValidator.test(PROJECT_NAME)) throw new IllegalArgumentException
             (M1 + "PROJECT_NAME] was not passed a valid name.");
        
         if (VERSION_MAJOR_NUMBER < 0) throw new IllegalArgumentException
             (M1 + "VERSION_MAJOR_NUMBER" + M3 + VERSION_MAJOR_NUMBER);
        
         if (VERSION_MINOR_NUMBER < 0) throw new IllegalArgumentException
             (M1 + "VERSION_MINOR_NUMBER" + M3 + VERSION_MINOR_NUMBER);
        
         if (JAVADOC_VER < 0) throw new IllegalArgumentException
             (M1 + "JAVADOC_VER" + M3 + JAVADOC_VER);
        
         if (FAVICON != null)
         {
             File f = new File(FAVICON);
        
             if ((! f.exists()) || (! f.isFile())) throw new FileNotFoundException(
                 "Field 'FAVICON' [" + FAVICON + "] points to a file that was not found, or " +
                 "isn't a File"
             );
        
             IF.guessOrThrow(FAVICON);
         }
        
         if (packageList.length == 0) throw new EmptyListException
             (M1 + "packageList] was passed a list of size 0.");
        
         for (BuildPackage bp : packageList) if (bp == null) throw new NullPointerException
             (M1 + "packageList] contains a null value.");
        
         for (String p : CLASS_PATH) if (p == null) throw new NullPointerException
             (M1 + "CLASS_PATH] contains a null value.");
        
         File f = new File(TAR_SOURCE_DIR);
         if (! (f.exists() && f.isDirectory())) throw new FileNotFoundException
             (M1 + "] was not passed a vaild File-System Directory-Name.");
        
         if (JAR_FILE_MOVE_DIR != null)
         {
             WritableDirectoryException.check(JAR_FILE_MOVE_DIR);
        
             if (! JAR_FILE_MOVE_DIR.endsWith(File.separator))
                 JAR_FILE_MOVE_DIR = JAR_FILE_MOVE_DIR + File.separator;
         }
        
         WritableDirectoryException.check(LOG_DIR);
        
         if (! LOG_DIR.endsWith(File.separator)) LOG_DIR = LOG_DIR + File.separator;