Class SourceSaxHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.torque.generator.configuration.source.SourceSaxHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Direct Known Subclasses:
FileSourceSaxHandler
,JdbcMetadataSourceSaxHandler
public abstract class SourceSaxHandler extends DefaultHandler
A base class for reading source definitions from the controller configuration file.
-
-
Constructor Summary
Constructors Constructor Description SourceSaxHandler(ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers)
Constructor.
-
Method Summary
Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endElement(String uri, String localName, String rawName)
protected void
finished()
Marks that the matching snippet was completely parsed.ConfigurationHandlers
getConfigurationHandlers()
Returns the known configuration handlers.ConfigurationProvider
getConfigurationProvider()
Returns the configurationProvider to access the configuration.SourceProcessConfiguration
getSourceProcessConfiguration()
Returns the information how to pre-process the sources before generating.abstract SourceProvider
getSourceProvider()
Returns the information how to read the sources.UnitDescriptor
getUnitDescriptor()
Returns the description of the generation unit.boolean
isFinished()
Returns whether the matching snippet was completely parsed.void
startElement(String uri, String localName, String rawName, Attributes attributes)
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
SourceSaxHandler
public SourceSaxHandler(ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, ConfigurationHandlers configurationHandlers)
Constructor.- Parameters:
configurationProvider
- The access object for the configuration files, not null.unitDescriptor
- The description of the generation unit, not null.configurationHandlers
- All known 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
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
getConfigurationProvider
public ConfigurationProvider getConfigurationProvider()
Returns the configurationProvider to access the configuration.- Returns:
- the configurationProvider to access the configuration, not null.
-
getConfigurationHandlers
public ConfigurationHandlers getConfigurationHandlers()
Returns the known configuration handlers.- Returns:
- the configuration handlers, not null.
-
getUnitDescriptor
public UnitDescriptor getUnitDescriptor()
Returns the description of the generation unit.- Returns:
- the description of the generation unit, not null.
-
isFinished
public boolean isFinished()
Returns whether the matching snippet was completely parsed.- Returns:
- true if the matching snippet was completely parsed, false otherwise.
-
finished
protected void finished()
Marks that the matching snippet was completely parsed.
-
getSourceProvider
public abstract SourceProvider getSourceProvider()
Returns the information how to read the sources.- Returns:
- the source Provider, not null if the source snippet was processed.
-
getSourceProcessConfiguration
public SourceProcessConfiguration getSourceProcessConfiguration()
Returns the information how to pre-process the sources before generating.- Returns:
- the sourceProcessConfiguration, not null if the source snippet was processed.
-
-