Package org.glassfish.pfl.tf.timer.spi
Class TimerPointSourceGenerator
- java.lang.Object
-
- org.glassfish.pfl.tf.timer.spi.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 Summary
Fields Modifier and Type Field Description private static java.util.Comparator<Named>
COMP
private static ImportList
standardImports
private static Type
Timer
private static Type
TimerEventController
private static Type
TimerFactory
private static Type
TimerGroup
-
Constructor Summary
Constructors Constructor Description TimerPointSourceGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
generateAccessorMethods(TimerFactory tf, boolean isImpl)
private static void
generateConstructor(TimerFactory tf, boolean generateController)
private static void
generateFields(TimerFactory tf, boolean generateController, boolean privateTimers)
static void
generateFile(java.lang.String dirName, Pair<java.lang.String,TimerFactory> description)
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.private static void
generateSingleClass(java.lang.String dirName, java.lang.String packageName, TimerFactory tf)
private static void
startFile(java.lang.String packageName)
private static void
writeFile(java.lang.String dirName, Type type)
-
-
-
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
-
-
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
-
-