Introduction

The Torque generator can handle different outlet types, currently velocity and java outlets. The velocity outlets use templates to produce the output, the java outlets create their output directly in java.

Configuration

As the different outlet types need different configurations, a custom configuration parser is needed for each outlet type. (The generator type is determined by the "xsi:type" attribute of the outlet and filenameOutlet elements in the project configuration). The Torque generator needs to be told which parser it should use for which outlet type. This is done by registering a outletHandlerFactory for each generator type, see the register methods in the org.apache.torque.generator.configuration.OutletTypes class. The outletTypes instance is accessible via the ConfigurationHandlers instance in the Configuration object. This could in principle be used to plug in new outlet types, but alas, the configuration object is hidden in the controller instance and not accessible from the outside :-(. However, there is one handler factory registered by default, the org.apache.torque.generator.configuration.outlet.ReflectionOutletSaxHandlerFactory, which can be used to access new outlet types using a naming convention; which suffices to register new outlet types.