Class RearrangeSummaries


  • public class RearrangeSummaries
    extends java.lang.Object
    RearrangeSummaries - Documentation.

    This class rearranges the summary sections in a JavaDoc Web-Page.

    For a more visual explanation of what the 'Summary 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 Summaries" 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.SummRearrange.java




Stateless Class: This class neither contains any program-state, nor can it be instantiated.
The @StaticFunctional Annotation may also be called 'The Spaghetti Report'
  • 1 Constructor(s), 1 declared private, zero-argument constructor
  • 4 Method(s), 4 declared static
  • 4 Field(s), 4 declared static, 4 declared final


    • Method Detail

      • run

        public static void run​(CommonParamRecord pr,
                               RearrangeSummaries.SummaryItems sort)
        Runs it.
        Parameters:
        pr - This contains all of the needed parameters for this method, encapsulated into a single record-class. The list is somewhat lengthy, so this makes the code "look cleaner"
        sort - The sort information requested by the user.
        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
         // This minor detail just makes sure we don't run a sort on any Summary-Section twice.
         // This is only for potential user-errror.  If they have provided two different sorting
         // functions for the same Summary-Section, an exception has to be thrown (or else a real
         // bad NullPointerException will eventually be thrown)
         TreeSet<FCM> alreadyRan = new TreeSet<>();
        
         // See if there is a match between the Class, Interface or Enum that was passed with one
         // of the user-requets for Summary-Rearrangement.
         //
         // NOTE: There may be more than one type of sort provided for the same class!
        
         for (int arrPos=0; arrPos < sort.ciets.length; arrPos++)
        
             if (sort.ciets[arrPos].equals(pr.cietFullName))
             {
                 FCM fcm = sort.sections[arrPos];
        
                 if (alreadyRan.contains(fcm)) throw new SummaryRearrangeException(
                     "While parsing the " + fcm + " list in the Summaries Section for File:\n" +
                     pr.jdFileName + "\nOne of the sorters provided is actually a second-sorter.  " +
                     "The " + fcm + " Summary Section, has already been sorted.  You have " +
                     "provided two sorts for the " + fcm + " Summary Section."
                 );
        
                 run(pr, fcm, sort.sectionNames[arrPos], sort.sorters[arrPos]);
        
                 alreadyRan.add(fcm);
             }