fr.umlv.tatoo.cc.common.xml
Class AbstractXMLDigester

java.lang.Object
  extended by fr.umlv.tatoo.cc.common.xml.XMLDigester
      extended by fr.umlv.tatoo.cc.common.xml.AbstractXMLDigester
Direct Known Subclasses:
LexerXMLDigester, ParserXMLDigester, ToolXMLDigester

public abstract class AbstractXMLDigester
extends XMLDigester

XML Digester that register AbstractXMLDigester.SAXlet used to process XML tags.

Author:
Remi

Nested Class Summary
static class AbstractXMLDigester.DefaultSAXlet
          Default AbstractXMLDigester.SAXlet implementation that can be used to recognized one XML element.
static interface AbstractXMLDigester.SAXlet
          Processing unit used to process one or more XML element.
 
Constructor Summary
protected AbstractXMLDigester()
          Creates a digester that use AbstractXMLDigester.SAXlet.
 
Method Summary
abstract  String getRootElementName()
          Retruns the name of the root element of the XML file.
protected abstract  AbstractXMLDigester.SAXlet[] getSAXLets()
          Retruns the saxlets registered by the digester.
abstract  Unit getUnit()
          Retruns the corresponding unit type.
 DefaultHandler handler()
           This implementation ensures that if no saxlet is registered, the saxlets returned by getSAXLets() are registered before return the handler.
 boolean isSaxletsRegistered()
          Returns true if at least a saxlet is registered.
 void registerSaxlets(AbstractXMLDigester.SAXlet... saxlets)
          Register saxlets used to parse the XML file.
 void unregisterSaxlets(AbstractXMLDigester.SAXlet... saxlets)
          Unregister saxlets used to parse the XML file.
 
Methods inherited from class fr.umlv.tatoo.cc.common.xml.XMLDigester
computeId, computeId, computeId, computeId, convert, convert, getLocator, parse, parse, reportError, reportError, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractXMLDigester

protected AbstractXMLDigester()
Creates a digester that use AbstractXMLDigester.SAXlet.

Method Detail

registerSaxlets

public void registerSaxlets(AbstractXMLDigester.SAXlet... saxlets)
Register saxlets used to parse the XML file.

Parameters:
saxlets - the saxlets to register.
See Also:
getSAXLets()

unregisterSaxlets

public void unregisterSaxlets(AbstractXMLDigester.SAXlet... saxlets)
Unregister saxlets used to parse the XML file.

Parameters:
saxlets - the saxlets to unregister.
See Also:
getSAXLets()

isSaxletsRegistered

public boolean isSaxletsRegistered()
Returns true if at least a saxlet is registered.

Returns:
true is a saxlet is registered.

getUnit

public abstract Unit getUnit()
Retruns the corresponding unit type.

Returns:
the unit type to parse.

getSAXLets

protected abstract AbstractXMLDigester.SAXlet[] getSAXLets()
Retruns the saxlets registered by the digester.

Returns:
the saxlets registered by the digester.

getRootElementName

public abstract String getRootElementName()
Retruns the name of the root element of the XML file.

Returns:
the name of the root element of the XML file.

handler

public DefaultHandler handler()
This implementation ensures that if no saxlet is registered, the saxlets returned by getSAXLets() are registered before return the handler.

Specified by:
handler in class XMLDigester