Class GroovyOutletSaxHandlerFactory
- java.lang.Object
-
- org.apache.torque.generator.configuration.outlet.GroovyOutletSaxHandlerFactory
-
- All Implemented Interfaces:
TypedOutletSaxHandlerFactory
public class GroovyOutletSaxHandlerFactory extends Object implements TypedOutletSaxHandlerFactory
Creates Groovy outlet SAX handlers.
-
-
Constructor Summary
Constructors Constructor Description GroovyOutletSaxHandlerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutletcreateOutletForTemplate(String templatePath, ConfigurationProvider configurationProvider)Creates an outlet for a template with the given file name.OutletSaxHandlergetOutletSaxHandler(QualifiedName outletName, ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers)Returns a GroovyOutletSaxHandler for reading the configuration of Groovy outlets.Collection<String>getTemplatesFilenameExtensionsForScan()Returns the filename extensions for templates which define outlets of this type.StringgetType()Returns the outlet type which can be handled by the OutletSaxHandlers created by this factory.
-
-
-
Method Detail
-
getType
public String getType()
Returns the outlet type which can be handled by the OutletSaxHandlers created by this factory.- Specified by:
getTypein interfaceTypedOutletSaxHandlerFactory- Returns:
- "groovyOutlet".
-
getTemplatesFilenameExtensionsForScan
public Collection<String> getTemplatesFilenameExtensionsForScan()
Returns the filename extensions for templates which define outlets of this type. These extensions are used for scanning the templates tree.- Specified by:
getTemplatesFilenameExtensionsForScanin interfaceTypedOutletSaxHandlerFactory- Returns:
- A list with the entry ".groovy".
-
createOutletForTemplate
public Outlet createOutletForTemplate(String templatePath, ConfigurationProvider configurationProvider) throws ConfigurationException
Creates an outlet for a template with the given file name.- Specified by:
createOutletForTemplatein interfaceTypedOutletSaxHandlerFactory- Parameters:
templatePath- the path to the template, relative to the templates directory, not null.configurationProvider- the configuration provider, not null.- Returns:
- the outlet, not null.
- Throws:
ConfigurationException- if the outlet cannot be created.
-
getOutletSaxHandler
public final OutletSaxHandler getOutletSaxHandler(QualifiedName outletName, ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers) throws SAXException
Returns a GroovyOutletSaxHandler for reading the configuration of Groovy outlets. This implementation uses the provided name as outlet name.- Specified by:
getOutletSaxHandlerin interfaceTypedOutletSaxHandlerFactory- Parameters:
outletName- the name for the outlet which configuration will be read in by the generated SaxHandlerFactory, or null if the name of the outlet should be determined from the parsed xml.configurationProvider- The access object for the configuration files, not null.unitDescriptor- The description of the generation unit, not null.configurationHandlers- the available configuration handlers, not null.- Returns:
- a new GroovyOutletSaxHandler.
- Throws:
SAXException- if the SAX Handler for the outlet can not be created from the given XML element.
-
-