public final class SourceTypes extends Registry<SourceType>
Modifier and Type | Field and Description |
---|---|
static SourceType |
None |
static SourceType |
Static |
Constructor and Description |
---|
SourceTypes()
Creates a new source type registry.
|
Modifier and Type | Method and Description |
---|---|
javafx.collections.ObservableList<java.lang.String> |
allAvailableSourceUris()
Gets a read-only observable list of all available source URIs of all the known types.
|
SourceType |
forName(java.lang.String name)
Gets the source type with the given name, or
None if that name has not been registered. |
DataSource<?> |
forUri(java.lang.String uri)
Creates a data source corresponding to the given URI.
|
static SourceTypes |
getDefault()
Gets the default source type registry.
|
void |
register(SourceType sourceType)
Registers a new source type.
|
java.lang.String |
stripProtocol(java.lang.String uri)
Tries to strip the protocol from a source URI.
|
SourceType |
typeForUri(java.lang.String uri)
Gets the source type associated with the given URI, or
None if the protocol is not recognized. |
void |
unregister(SourceType sourceType)
Unregisters an item from this registry.
|
addItem, getItems, isRegistered, registerAll, registerAll, registerIfAbsent, removeItem, unregisterAll, unregisterAll
public static final SourceType None
public static final SourceType Static
public static SourceTypes getDefault()
public void register(SourceType sourceType)
register
in class Registry<SourceType>
sourceType
- the source type to registerjava.lang.IllegalArgumentException
- if a source type has already been registered with the same namejava.lang.IllegalArgumentException
- if a source type has already been registered with the same protocolpublic void unregister(SourceType sourceType)
unregister
in class Registry<SourceType>
sourceType
- the item to unregisterjava.lang.IllegalArgumentException
- if attempting to unregister None
or Static
public DataSource<?> forUri(java.lang.String uri)
DataSource.none()
is returned.uri
- the URI to create a source forpublic SourceType forName(java.lang.String name)
None
if that name has not been registered.name
- the name of the source type to getpublic SourceType typeForUri(java.lang.String uri)
None
if the protocol is not recognized.public java.lang.String stripProtocol(java.lang.String uri)
uri
- the uri to strip the protocol frompublic javafx.collections.ObservableList<java.lang.String> allAvailableSourceUris()