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

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.torque.generator.configuration.source.SourceTransformerSaxHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class SourceTransformerSaxHandler
extends DefaultHandler

Reads a source transformer from the controller configuration file.


Constructor Summary
SourceTransformerSaxHandler(ConfigurationProvider configurationProvider, ProjectPaths projectPaths)
          Constructor.
 
Method Summary
 void characters(char[] ch, int start, int length)
          
 void endElement(String uri, String localName, String rawName)
          
 String getElements()
          Returns the path to source elements to which the transformer is applied.
 SourceTransformer getSourceTransformer()
          Returns the configuration filled with the contents of the parsed snippet.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceTransformerSaxHandler

public SourceTransformerSaxHandler(ConfigurationProvider configurationProvider,
                                   ProjectPaths projectPaths)
Constructor.

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

getSourceTransformer

public SourceTransformer getSourceTransformer()
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.

getElements

public String getElements()
Returns the path to source elements to which the transformer is applied.

Returns:
the path to the source element, or null to apply the transformer to the root element.

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.


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