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 Details

    • 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 Details

    • startElement

      public void startElement(String uri, String localName, String rawName, Attributes attributes) throws SAXException
      Specified by:
      startElement in interface ContentHandler
      Overrides:
      startElement in class DefaultHandler
      Throws:
      SAXException
    • endElement

      public void endElement(String uri, String localName, String rawName) throws SAXException
      Specified by:
      endElement in interface ContentHandler
      Overrides:
      endElement in class DefaultHandler
      Throws:
      SAXException
    • characters

      public void characters(char[] ch, int start, int length) throws SAXException
      Specified by:
      characters in interface ContentHandler
      Overrides:
      characters in class DefaultHandler
      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.