Class ConfigurableClassSaxHandler<T>
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.torque.generator.configuration.source.ConfigurableClassSaxHandler<T>
-
- Type Parameters:
T
- the class to create.
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class ConfigurableClassSaxHandler<T> extends DefaultHandler
Reads a configurable class from the controller configuration file.
-
-
Constructor Summary
Constructors Constructor Description ConfigurableClassSaxHandler(ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, String tagNameToProcess)
Constructor.
-
Method Summary
Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endElement(String uri, String localName, String rawName)
T
getConfiguredClass()
Returns the configured class.boolean
isFinished()
Returns the configuration filled with the contents of the parsed snippet.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
-
ConfigurableClassSaxHandler
public ConfigurableClassSaxHandler(ConfigurationProvider configurationProvider, UnitDescriptor unitDescriptor, String tagNameToProcess)
Constructor.- Parameters:
configurationProvider
- The access object for the configuration files, not null.unitDescriptor
- The description of the generation unit, not null.tagNameToProcess
- the name of the XML Tag to process, 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
-
getConfiguredClass
public T getConfiguredClass()
Returns the configured class.- Returns:
- the configured class, not null if a matching snippet was processed.
-
isFinished
public boolean isFinished()
Returns the configuration filled with the contents of the parsed snippet.- Returns:
- the configuration which was filled, not null if a matching snippet was processed.
-
-