As mentioned earlier,
AbstractGenTemplate defines two member
StaticGenerator. They are identical, except
Generator is a (non-static) inner class, while
StaticGenerator is static.
GenTemplate class similarly declares two member classes:
Generator that extends
StaticGenerator that extends
The reason for this is historical. Long ago, the entire
interface was flat, in contrast to its current nested form. This led
to problems, because there were cases in which RepreZen API Studio could not
instantiate, and therefore could not discover,
generators made use of libraries not available in the RepreZen API Studio runtime.
To solve this problem we split the interface into its current
form. However, when adapting existing GenTemplates, we made a decision
to ease our work: we made the
Generator member classes inner
classes, rather than static member classes. This was easiser because
all access to the containing outer class members still worked!
Unfortunately, this structure is clumsy, and it makes it impossible to
create generator classes that are reusable across multiple
GenTemplates, since each generator class must be a non-static inner
class member of any GenTemplate class that wishes to use it.
There is no particular problem in locating the generator classes
within the GenTemplate classes; the problem is that they are not
We have now deprecated the non-static inner classes, but we retain
them for backward compatibility. However, we also now create static
versions of these classes, with constructors through which the
GenTemplate instance and its context object are conveyed to the
GenTemplate.Generator class is now a simple class
that instantiates and delegates to an instance of