|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.zuercher.gpx2map.source.SourceFactory
public abstract class SourceFactory
SourceFactory creates MapSource
implementations. It uses the
name given to createMapSource(String)
as the basis of, or to look
up, the name of a package containing a concrete implementation of
SourceFactory
. The concrete implementation must be named
"Factory" and is instantiated through reflection. The method
newMapSource()
is then called to create a new MapSource.
The package name is generated as follows:
SourceFactory is not re-entrant w.r.t. createMapSource(String)
and getLastThrown()
. Synchronize access to SourceFactory if you
require multi-threaded access.
Field Summary | |
---|---|
private static String |
BUILT_IN_PKG
|
private static List<String> |
builtInSources
|
private static String |
FACTORY_NAME
|
private static String |
PROP_PREFIX
|
private static Throwable |
thrown
|
Constructor Summary | |
---|---|
SourceFactory()
|
Method Summary | |
---|---|
private static String |
buildAddOnPackageName(String name)
|
private static String |
buildBuiltInPackageName(String name)
|
static MapSource |
createMapSource(String name)
Create a new MapSource . |
private static List<String> |
generateBuiltInSources()
Generates an unmodifiable List of Strings
that represent the names of the built-in map sources. |
static List<MapSourceDescriptor> |
getAvailableSources()
Returns a List of known source descriptors . |
static Throwable |
getLastThrown()
Returns any exception thrown during construction of the implementation's UtmMapSource. |
abstract MapSourceDescriptor |
getMapSourceDescriptor()
Returns a MapSourceDescriptor for this SourceFactory . |
private static MapSource |
instantiateMapSource(String name)
|
private static SourceFactory |
instantiateSourceFactory(String name)
|
protected abstract MapSource |
newMapSource()
Returns a newly instantiated MapSource . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String PROP_PREFIX
private static final String BUILT_IN_PKG
private static final String FACTORY_NAME
private static final List<String> builtInSources
private static Throwable thrown
Constructor Detail |
---|
public SourceFactory()
Method Detail |
---|
public static MapSource createMapSource(String name)
MapSource
. See the class description for how an
implementation's factory class is found.
name
- implementation name
getLastThrown()
public static Throwable getLastThrown()
createMapSource(String)
.
public static List<MapSourceDescriptor> getAvailableSources()
descriptors
.
private static SourceFactory instantiateSourceFactory(String name)
private static MapSource instantiateMapSource(String name)
private static String buildAddOnPackageName(String name)
private static String buildBuiltInPackageName(String name)
private static List<String> generateBuiltInSources()
List
of Strings
that represent the names of the built-in map sources. If the system
property "gpx2map.debug"
is set to
"true", the dummy map source
is included for multi-source testing.
public abstract MapSourceDescriptor getMapSourceDescriptor()
MapSourceDescriptor
for this SourceFactory
.
protected abstract MapSource newMapSource()
MapSource
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |