org.openstreetmap.osmosis.core.xml.common
Class DummyElementProcessor

java.lang.Object
  extended by org.openstreetmap.osmosis.core.xml.common.BaseElementProcessor
      extended by org.openstreetmap.osmosis.core.xml.common.DummyElementProcessor
All Implemented Interfaces:
ElementProcessor

public class DummyElementProcessor
extends BaseElementProcessor

Provides a no-op implementation of an element processor. This implementation is provided to allow nested elements to be ignored if they are not required.

Author:
Brett Henderson

Constructor Summary
DummyElementProcessor(BaseElementProcessor parentProcessor)
          Creates a new instance.
 
Method Summary
 void begin(org.xml.sax.Attributes attributes)
          This implementation does not do any processing.
 void end()
          This implementation does not do any processing.
 ElementProcessor getChild(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          This implementation returns itself and increments an internal counter.
 ElementProcessor getParent()
          This implementation decrements an internal counter, if the counter reaches zero the true parent is returned, else this instance is returned.
 
Methods inherited from class org.openstreetmap.osmosis.core.xml.common.BaseElementProcessor
createTimestampContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyElementProcessor

public DummyElementProcessor(BaseElementProcessor parentProcessor)
Creates a new instance.

Parameters:
parentProcessor - The parent of this element processor.
Method Detail

begin

public void begin(org.xml.sax.Attributes attributes)
This implementation does not do any processing.

Parameters:
attributes - The attributes of the new element.

getChild

public ElementProcessor getChild(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName)
This implementation returns itself and increments an internal counter. The corresponding getParent method decrements the counter and when it reaches zero returns the true parent of this instance.

Specified by:
getChild in interface ElementProcessor
Overrides:
getChild in class BaseElementProcessor
Parameters:
uri - The element uri.
localName - The element localName.
qName - The element qName.
Returns:
This instance.

getParent

public ElementProcessor getParent()
This implementation decrements an internal counter, if the counter reaches zero the true parent is returned, else this instance is returned.

Specified by:
getParent in interface ElementProcessor
Overrides:
getParent in class BaseElementProcessor
Returns:
The element processor for the parent of the current element.

end

public void end()
This implementation does not do any processing.