Class RearrangePkgFrame.PackageItems

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    RearrangePkgFrame

    public static class RearrangePkgFrame.PackageItems
    extends java.lang.Object
    implements java.io.Serializable
    PackageItems - Documentation.

    This class needs to be filled with lists of classes in order to rearrange the Java Doc files package-frame.html

    For a more visual explanation of what the 'Package Items' are, please review the following before and after screen clips:



    Below is a sample of what the arrays should look like in order for this upgrader to perform such an upgrade. This is the "Rearrange Frames" list of arrays used to build the Java HTML Library. This file is quite long, but reading might make it easier to understand what actually belongs inside these arrays.

    Torello.Build.Helper.PackageItems.java
    See Also:
    Serialized Form




    • Field Detail

      • serialVersionUID

        protected static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
        See Also:
        Constant Field Values
        Code:
        Exact Field Declaration Expression:
        1
        protected static final long serialVersionUID = 1;
        
      • packages

        public final java.lang.String[] packages
        Complete list of fully qualified Package Names
        Code:
        Exact Field Declaration Expression:
        1
        public final String[]       packages;
        
      • sectionNames

        public final java.lang.String[][] sectionNames
        A 'List of Lists'. Each sub-array contains the list of 'Sections' inside a 'package-frame.html' file. The first-order of the String-Array must be parallel to the names listed in the 'Package Names' array.
        Code:
        Exact Field Declaration Expression:
        1
        public final String[][]     sectionNames;
        
      • sectionContents

        public final java.lang.String[][][] sectionContents
        A Three-Dimensional String-Array. The first-order of the String Array must also be parallel to the names listed in the 'Package Names' array.
        Code:
        Exact Field Declaration Expression:
        1
        public final String[][][]   sectionContents;
        
      • usesFrames

        public final boolean usesFrames
        Indicates whether the user has opted to use the package-frames.html version of Java Doc.
        Code:
        Exact Field Declaration Expression:
        1
        public final boolean        usesFrames;
        
    • Constructor Detail

      • PackageItems

        public PackageItems​(java.lang.String[] packages,
                            java.lang.String[][] sectionNames,
                            java.lang.String[][][] sectionContents,
                            boolean usesFrames)
        Constructs a new instance of this class 'PackageItems'

        This is a sample of what the input arrays should look like:

        Torello.Build.Helper.PackageItems.java
        Parameters:
        packages - The list of packages as a String-Array
        sectionNames - A Two-Dimensional String-Array that is parallel to the previous 'packages' parameter. Each sub-array here should contain the list of section names for the package in the parallel array.
        sectionContents - A Three-Dimensional String-Array. The first dimension is parallel to both of the other two input array-parameters. Each of the sub-two-dimensional arrays merely / simply (this is not rocket-science) contains a list of classes (and interfaces, enum's, exceptions, etc...) that you want inside the "section" identified by the corresponding element of the 'sectionNames'-array.
        usesFrames - Since there are two locations that may possible list the contents of a Java Package (both package-summary.html and package-frame.html), this boolean indicates whether you have opted to use the 'frames' version of JavaDoc. Though this option has been officially deprecated in later versions of Java, the 'frames' option was an extremely convenient way for traversing classes.

        IMPORTANT: If this parameter receives TRUE, both of the aforementioned files shall have their contents rearranged according to these arrays. If FALSE is passed, only the package-summary.html pages will be rearranged.
        Throws:
        ParallelArrayException - If any of these three arrays aren't of equal lengths!
        java.lang.NullPointerException - If any of these arrays contain any 'null' values
        See Also:
        Upgrade.setPackageFrames(String[], String[][], String[][][], boolean), Upgrade.rearrangeFrames
    • Method Detail

      • checkArrays

        public void checkArrays()
        Checks to ensure that the arrays are parallel, and that there are no nulls
        Code:
        Exact Method Body:
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        22
        23
        24
        25
        26
        27
        28
        29
        30
        31
        32
        33
        34
        35
        36
        37
        38
        39
         ParallelArrayException.check
             (packages, "packages", true, sectionNames, "sectionNames", true);
        
         ParallelArrayException.check
             (sectionNames, "sectionNames", false, sectionContents, "sectionContents", true);
        
         // The only purpose of this is to make sure the Exception Message is detailed enough
         // to make it easy to find th bug
         for (int i=0; i < sectionNames.length; i++)
         {
             if (sectionNames[i].length != sectionContents[i].length)
        
                 throw new IllegalArgumentException(
                     "packages[" + i + "] is named: '" + packages[i] + "'\n" +
                     "sectionNames[" + i + "].length is " + sectionNames[i].length + '\n' +
                     "sectionContents[" + i + "].length is " + sectionContents[i].length + ".\n" +
                     "These sub-arrays must be parallel, and thus must have equal length.\n" +
                     "FOR REFERENCE: sectionNames[" + i + "] = " +
                     "{" + StrCSV.toCSV(sectionNames[i], true, true, null) + "}\n"
                 );
        
             for (int j=0; j < sectionNames[i].length; j++)
        
                 if (sectionNames[i][j] == null) throw new NullPointerException(
                     "sectionNames[" + i + "][" + j + "] contains a null value.\n" +
                     "FOR REFERENCE: packages[" + i + "] has name '" + packages[i] + "'\n"
                 );
        
             for (int j=0; j < sectionContents[i].length; j++)
        
                 for (int k=0; k < sectionContents[i][j].length; k++)
        
                     if (sectionContents[i][j][k] == null) throw new NullPointerException(
                         "sectionContents[" + i + "][" + j + "][" + k + "] contains a null value.\n" +
                         "FOR REFERENCE: packages[" + i + "] has name '" + packages[i] + "'\n" +
                         "FOR REFERENCE: sectionNames[" + i + "] = " +
                         "{" + StrCSV.toCSV(sectionNames[i], true, true, null) + "}\n"
                     );
         }