Class TimerPointSourceGenerator


  • public class TimerPointSourceGenerator
    extends java.lang.Object
    Used to generate a class that represents all Timers found in a TF source file. Uses the codegen library to generate the source file.
    • Field Detail

      • COMP

        private static final java.util.Comparator<Named> COMP
      • TimerFactory

        private static Type TimerFactory
      • Timer

        private static Type Timer
      • TimerEventController

        private static Type TimerEventController
      • TimerGroup

        private static Type TimerGroup
      • standardImports

        private static ImportList standardImports
    • Constructor Detail

      • TimerPointSourceGenerator

        public TimerPointSourceGenerator()
    • Method Detail

      • generateFile

        public static void generateFile​(java.lang.String dirName,
                                        Pair<java.lang.String,​TimerFactory> description)
                                 throws java.io.IOException
        Generate a single class which contains:
        • private fields for Timers and TimerGroups
        • public accessor methods for Timers and TimerGroups
        • A public constructor <init>(TimerFactory) that initializes the Timer and TimerGroup fields, and the TimerGroup containment.
        Parameters:
        dirName -
        description -
        Throws:
        java.io.IOException
      • generateSingleClass

        private static void generateSingleClass​(java.lang.String dirName,
                                                java.lang.String packageName,
                                                TimerFactory tf)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • startFile

        private static void startFile​(java.lang.String packageName)
      • generateFields

        private static void generateFields​(TimerFactory tf,
                                           boolean generateController,
                                           boolean privateTimers)
      • generateConstructor

        private static void generateConstructor​(TimerFactory tf,
                                                boolean generateController)
      • generateAccessorMethods

        private static void generateAccessorMethods​(TimerFactory tf,
                                                    boolean isImpl)
      • writeFile

        private static void writeFile​(java.lang.String dirName,
                                      Type type)
                               throws java.io.IOException
        Throws:
        java.io.IOException