org.apache.torque.generator.configuration.mergepoint
Class MergepointSaxHandler

java.lang.Object
  extended by org.apache.torque.generator.configuration.mergepoint.MergepointSaxHandler

public class MergepointSaxHandler
extends Object

A SAX Handler which processes a mergepoint configuration in an outlet.


Constructor Summary
MergepointSaxHandler(ConfigurationProvider configurationProvider, ProjectPaths projectPaths, ConfigurationHandlers configurationHandlers)
          Constructor.
 
Method Summary
 void endElement(String uri, String localName, String qName)
          Callback method which is called by the SAX parser if an XML element is ended.
 MergepointMapping getMergepointMapping()
          Returns the mergepointMapping configured by this SaxHandler.
 boolean isFinished()
          Returns whether the parser has finished parsing the mergepoint tag.
 void startElement(String uri, String localName, String qName, Attributes attributes)
          Callback method which is called by the SAX parser if an XML element is started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergepointSaxHandler

public MergepointSaxHandler(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 - the available configuration handlers, not null.
Throws:
NullPointerException - if an argument is null.
Method Detail

getMergepointMapping

public MergepointMapping getMergepointMapping()
Returns the mergepointMapping configured by this SaxHandler. If this method is called before the mergepoint tag has been processed completely, it will throw an IllegalStateException.

Returns:
the complete mergepointMapping, never null.
Throws:
IllegalStateException - if the mergepoint tag has not been processed completely.

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Callback method which is called by the SAX parser if an XML element is started. If a known element is encountered, its settings are read and applied to the mergepoint; if an unknown element is encountered, a SaxException is thrown.

Parameters:
uri - The namespace URI of the started element, or the empty string if the element has no namespace URI or if namespace processing is not being performed.
localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified name (with prefix, if present), or the empty string if qualified names are not available.
attributes - The attributes attached to the element.
Throws:
SAXException - if an error occurs during parsing.
See Also:
ContentHandler.startElement(String, String, String, Attributes)

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
Callback method which is called by the SAX parser if an XML element is ended. If an action element is ended, the action is added to the action list for the mergepoint. If the mergepoint element is ended, the parser marks itself as finished.

Parameters:
uri - The namespace URI of the ended element, or the empty string if the element has no namespace URI or if namespace processing is not being performed.
localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified name (with prefix, if present), or the empty string if qualified names are not available.
See Also:
ContentHandler.endElement(String, String, String)

isFinished

public boolean isFinished()
Returns whether the parser has finished parsing the mergepoint tag.

Returns:
true if the parser has finished, false otherwise.


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