<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
-->

<document>

 <properties>
  <title>Outlet Types</title>
 </properties>

 <body>
  <section name="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.
  </section>
  
  <section name="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
    <code>org.apache.torque.generator.configuration.OutletTypes</code> 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 
    <code>org.apache.torque.generator.configuration.outlet.ReflectionOutletSaxHandlerFactory</code>,
    which can be used to access new outlet types using a naming convention;
    which suffices to register new outlet types.
  </section>
  
 </body>
</document>