Class OutletSaxHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.torque.generator.configuration.outlet.OutletSaxHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public abstract class OutletSaxHandler extends DefaultHandler
Handles a outlet declaration within the outlet configuration. Base class for more specific handlers.
-
-
Constructor Summary
Constructors Constructor Description OutletSaxHandler(QualifiedName outletName, ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers)
Creates a OutletSaxHandler.
-
Method Summary
Modifier and Type Method Description protected abstract Outlet
createOutlet(QualifiedName outletName, String uri, String localName, String rawName, Attributes attributes)
void
endElement(String uri, String localName, String rawName)
ConfigurationHandlers
getConfigurationHandlers()
Returns the configuration handlers.ConfigurationProvider
getConfigurationProvider()
Returns the ConfigurationProvider.Outlet
getOutlet()
Returns the outlet being configured.UnitDescriptor
getUnitDescriptor()
Returns the description of the generation unit.boolean
isFinished()
Returns whether we are past the end of the outlet configuration XML snippet which we are parsing.protected boolean
isProcessingMergepointTag()
Returns whether we are currently processing a mergepoint tag.void
startElement(String uri, String localName, String rawName, Attributes attributes)
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
OutletSaxHandler
public OutletSaxHandler(QualifiedName outletName, ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers)
Creates a OutletSaxHandler.- 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.- Throws:
NullPointerException
- if an argument is null.
-
-
Method Detail
-
startElement
public void startElement(String uri, String localName, String rawName, Attributes attributes) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String rawName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
createOutlet
protected abstract Outlet createOutlet(QualifiedName outletName, String uri, String localName, String rawName, Attributes attributes) throws SAXException
- 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.uri
- - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName
- - The local name (without prefix), or the empty string if Namespace processing is not being performed.rawName
- - The qualified name (with prefix), or the empty string if qualified names are not available.attributes
- - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.- Returns:
- the outlet, not null.
- Throws:
SAXException
- if the outlet cannot be created.
-
getOutlet
public Outlet getOutlet()
Returns the outlet being configured.- Returns:
- the outlet, not null.
-
isProcessingMergepointTag
protected boolean isProcessingMergepointTag()
Returns whether we are currently processing a mergepoint tag.- Returns:
- true if we are currently processing a mergepoint tag, false otherwise.
-
isFinished
public boolean isFinished()
Returns whether we are past the end of the outlet configuration XML snippet which we are parsing.- Returns:
- true if the whole snippet has been processed, false otherwise.
-
getConfigurationProvider
public ConfigurationProvider getConfigurationProvider()
Returns the ConfigurationProvider.- Returns:
- the ConfigurationProvider, not null.
-
getUnitDescriptor
public UnitDescriptor getUnitDescriptor()
Returns the description of the generation unit.- Returns:
- the description of the generation unit, not null.
-
getConfigurationHandlers
public ConfigurationHandlers getConfigurationHandlers()
Returns the configuration handlers.- Returns:
- the configuration handlers, not null.
-
-