org.apache.commons.latka.xml
Class FindVariablesHandler

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.apache.commons.latka.xml.FindVariablesHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class FindVariablesHandler
extends org.xml.sax.helpers.DefaultHandler

This handler is used by the XMLPreprocessr#findVariablesFro,URI(String) method to read the external entities of an XML suite and find any variables referenced there. The only purpose of the suite is to leverage SAX's awareness of these entities' locations.

Author:
Morgan Delagrange
See Also:
XMLPreprocessr#findVariablesFromURI(String)

Constructor Summary
FindVariablesHandler()
           
 
Method Summary
 java.util.Set getVariables()
          After the parse is complete, this method returns the unique variables referenced in the external entities.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          For each entity, find all the variables and assign them to the Set.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindVariablesHandler

public FindVariablesHandler()
Method Detail

getVariables

public java.util.Set getVariables()
After the parse is complete, this method returns the unique variables referenced in the external entities.

Returns:
Set of unique variables

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException
For each entity, find all the variables and assign them to the Set.

Parameters:
publicId - public id of entity, as defined by SAX
systemId - file URI of the external entity
Returns:
InputSource used by SAX to find more entities
Throws:
org.xml.sax.SAXException - if the entity could not be read


Copyright © 2001 Apache Software Foundation. Documenation generated September 27 2004.