org.onebusaway.transit_data_federation.bundle.tasks
Class EntityReplacementStrategyFactory
java.lang.Object
org.onebusaway.transit_data_federation.bundle.tasks.EntityReplacementStrategyFactory
public class EntityReplacementStrategyFactory
- extends Object
Factory for constructing EntityReplacementStrategy
instances from
file data. You can setup entity mappings using the
setEntityMappings(Map)
to supply the mappings and then
create()
to generate the strategy instance.
What do the mappings look like? The setEntityMappings(Map)
method
accepts a map of class to file objects, where the class indicates the entity
type to perform replacement on and the file specifies the actual id mappings.
The file takes the following format:
# Comments are supported
agencyId_replacementEntityIdA agencyId_toBeReplacedEntityIdB [...]
agencyId_replacementEntityIdC agencyId_toBeReplacedEntityIdD [...]
Here entity ids are of the string serialized form of AgencyAndId
, as
parsed by AgencyAndIdLibrary
. The first entity on a line is the
replacement entity id, while all subsequent entities (separated by
whitespace) are entity ids that should be replaced with the replacement id.
- Author:
- bdferris
- See Also:
EntityReplacementStrategy
,
GtfsReadingSupport
,
GtfsMultiReaderImpl
,
EntityReplacementStrategyImpl
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EntityReplacementStrategyFactory
public EntityReplacementStrategyFactory()
setEntityMappings
public void setEntityMappings(Map<Class<?>,String> mappings)
test
public void test()
create
public EntityReplacementStrategy create()
throws IOException
- Throws:
IOException
Copyright © 2012 OneBusAway. All Rights Reserved.