Class OutletSaxHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.torque.generator.configuration.outlet.OutletSaxHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
Handles a outlet declaration within the outlet configuration.
Base class for more specific handlers.
-
Constructor Summary
ConstructorsConstructorDescriptionOutletSaxHandler(QualifiedName outletName, ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers) Creates a OutletSaxHandler. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract OutletcreateOutlet(QualifiedName outletName, String uri, String localName, String rawName, Attributes attributes) voidendElement(String uri, String localName, String rawName) Returns the configuration handlers.Returns the ConfigurationProvider.Returns the outlet being configured.Returns the description of the generation unit.booleanReturns whether we are past the end of the outlet configuration XML snippet which we are parsing.protected booleanReturns whether we are currently processing a mergepoint tag.voidstartElement(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, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
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 Details
-
startElement
public void startElement(String uri, String localName, String rawName, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin 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
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
Returns the ConfigurationProvider.- Returns:
- the ConfigurationProvider, not null.
-
getUnitDescriptor
Returns the description of the generation unit.- Returns:
- the description of the generation unit, not null.
-
getConfigurationHandlers
Returns the configuration handlers.- Returns:
- the configuration handlers, not null.
-