Class ReflectionOutletSaxHandlerFactory
java.lang.Object
org.apache.torque.generator.configuration.outlet.ReflectionOutletSaxHandlerFactory
- All Implemented Interfaces:
UntypedOutletSaxHandlerFactory
public class ReflectionOutletSaxHandlerFactory
extends Object
implements UntypedOutletSaxHandlerFactory
Creates outlet SAX handlers using reflection and a naming convention.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a ReflectionOutletSaxHandlerFactory with the default sax handler package.ReflectionOutletSaxHandlerFactory(String saxHandlerPackage) Creates a ReflectionOutletSaxHandlerFactory with the default sax handler package. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(String type, UnitDescriptor unitDescriptor) Returns whether the handler can create OutletSaxHandlers for the given type.protected StringReturns the fully qualified class name of the handler class for a given type.final OutletSaxHandlergetOutletSaxHandler(String outletType, QualifiedName outletName, ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers) Returns a OutletSaxHandler for reading the configuration of the outlet.getType()Returns the outlet type which can be handled by the OutletSaxHandlers created by this factory.
-
Constructor Details
-
ReflectionOutletSaxHandlerFactory
public ReflectionOutletSaxHandlerFactory()Creates a ReflectionOutletSaxHandlerFactory with the default sax handler package. -
ReflectionOutletSaxHandlerFactory
Creates a ReflectionOutletSaxHandlerFactory with the default sax handler package.- Parameters:
saxHandlerPackage- the package where the Sax handlers reside.
-
-
Method Details
-
getType
Returns the outlet type which can be handled by the OutletSaxHandlers created by this factory.- Returns:
- null.
-
getOutletSaxHandler
public final OutletSaxHandler getOutletSaxHandler(String outletType, QualifiedName outletName, ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers) throws SAXException Returns a OutletSaxHandler for reading the configuration of the outlet. This implementation uses the provided name as outlet name.- Specified by:
getOutletSaxHandlerin interfaceUntypedOutletSaxHandlerFactory- Parameters:
outletType- the type of the outlet, not null.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 VelocityOutletSaxHandler.
- Throws:
SAXException- if the SAX Handler for the outlet can not be created from the given XML element.
-
canHandle
Description copied from interface:UntypedOutletSaxHandlerFactoryReturns whether the handler can create OutletSaxHandlers for the given type.- Specified by:
canHandlein interfaceUntypedOutletSaxHandlerFactory- Parameters:
type- the type to check.unitDescriptor- The description of the generation unit, not null.- Returns:
- true if the type is supported, false if not.
-
getFullyQualifiedHandlerClassName
Returns the fully qualified class name of the handler class for a given type.- Parameters:
type- the type to determine the handler for.- Returns:
- the fully qualified class name, not null.
-