org.openstreetmap.osmosis.core.xml.v0_6.impl
Class EntityElementProcessor

java.lang.Object
  extended by org.openstreetmap.osmosis.core.xml.common.BaseElementProcessor
      extended by org.openstreetmap.osmosis.core.xml.v0_6.impl.SourceElementProcessor
          extended by org.openstreetmap.osmosis.core.xml.v0_6.impl.EntityElementProcessor
All Implemented Interfaces:
ElementProcessor
Direct Known Subclasses:
NodeElementProcessor, RelationElementProcessor, WayElementProcessor

public abstract class EntityElementProcessor
extends SourceElementProcessor

Provides common element processor functionality for all entity processors.

Author:
Brett Henderson

Constructor Summary
EntityElementProcessor(BaseElementProcessor parentProcessor, Sink sink, boolean enableDateParsing)
          Creates a new instance.
 
Method Summary
protected  long buildChangesetId(java.lang.String rawChangesetId)
          Parses a changeset id based on the provided attribute value.
protected  OsmUser buildUser(java.lang.String rawUserId, java.lang.String rawUserName)
          Creates a user instance appropriate to the arguments.
 
Methods inherited from class org.openstreetmap.osmosis.core.xml.v0_6.impl.SourceElementProcessor
getSink
 
Methods inherited from class org.openstreetmap.osmosis.core.xml.common.BaseElementProcessor
createTimestampContainer, getChild, getParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.osmosis.core.xml.common.ElementProcessor
begin, end
 

Constructor Detail

EntityElementProcessor

public EntityElementProcessor(BaseElementProcessor parentProcessor,
                              Sink sink,
                              boolean enableDateParsing)
Creates a new instance.

Parameters:
parentProcessor - The parent of this element processor.
sink - The sink for receiving processed data.
enableDateParsing - If true, dates will be parsed from xml data, else the current date will be used thus saving parsing time.
Method Detail

buildUser

protected OsmUser buildUser(java.lang.String rawUserId,
                            java.lang.String rawUserName)
Creates a user instance appropriate to the arguments. This includes identifying the case where no user is available.

Parameters:
rawUserId - The value of the user id attribute.
rawUserName - The value of the user name attribute.
Returns:
The appropriate user instance.

buildChangesetId

protected long buildChangesetId(java.lang.String rawChangesetId)
Parses a changeset id based on the provided attribute value. If no attribute is available it will be defaulted to 0.

Parameters:
rawChangesetId - The raw changeset id attribute value.
Returns:
The parsed changeset id.