org.apache.torque.generator.configuration.source
Class SourceSaxHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by 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
SourceSaxHandler(ConfigurationProvider configurationProvider, ProjectPaths projectPaths, ConfigurationHandlers configurationHandlers)
          Constructor.
 
Method Summary
 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.
 ProjectPaths getProjectPaths()
          Returns the paths of the surrounding project.
 SourceProcessConfiguration getSourceProcessConfiguration()
          Returns the information how to post-process the sources after loading.
abstract  SourceProvider getSourceProvider()
          Returns the information how to read the sources.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceSaxHandler

public SourceSaxHandler(ConfigurationProvider configurationProvider,
                        ProjectPaths projectPaths,
                        ConfigurationHandlers configurationHandlers)
Constructor.

Parameters:
configurationProvider - The access object for the configuration files, not null.
projectPaths - The paths of the surrounding project, 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 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.

getProjectPaths

public ProjectPaths getProjectPaths()
Returns the paths of the surrounding project.

Returns:
the paths of the surrounding project, 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 post-process the sources after loading.

Returns:
the sourceProcessConfiguration, not null if the source snippet was processed.


Copyright © 2000-2012 The Apache Software Foundation. All Rights Reserved.