public abstract class ResourceLoader
extends java.lang.Object
Defines a general access point of loading any text resources and services.
Specification: All external subclasses must have a public no-arg constructor.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EXTERNAL_RESOURCE_LOADER
Name der system property, über die eine externe Instanz verwendet wird.
|
| Modifier and Type | Method and Description |
|---|---|
static ResourceLoader |
getInstance()
Applications should never use the constructor but this static method to achieve a general instance.
|
abstract java.io.InputStream |
load(java.net.URI uri,
boolean noCache)
Loads given resource as input stream.
|
abstract java.net.URI |
locate(java.lang.String moduleName,
java.lang.Class<?> moduleRef,
java.lang.String path)
Constructs an URI for given module resource.
|
abstract <S> java.lang.Iterable<S> |
services(java.lang.Class<S> serviceInterface)
Finds a collection of service providers available for given service provider interface.
|
public static final java.lang.String EXTERNAL_RESOURCE_LOADER
Name der system property, über die eine externe Instanz verwendet wird.
Time4J wird einen Error werfen, wenn der Konfigurationseintrag falsch ist.
public static ResourceLoader getInstance()
Applications should never use the constructor but this static method to achieve a general instance.
ResourceLoaderpublic abstract java.net.URI locate(java.lang.String moduleName,
java.lang.Class<?> moduleRef,
java.lang.String path)
Constructs an URI for given module resource.
Some implementations might yield an uri without verifying if the uri resource really exists.
moduleName - name of related time4j-modulemoduleRef - module-specific class referencepath - path to text resource (must be understandable by class loaders)null if unable to locate the resourcepublic abstract java.io.InputStream load(java.net.URI uri,
boolean noCache)
Loads given resource as input stream.
Callers are responsible for closing the result stream.
uri - uniform resource identifier as result of locate-method (optional)noCache - avoid caching?null if the resource could not be openedlocate(String, Class, String)public abstract <S> java.lang.Iterable<S> services(java.lang.Class<S> serviceInterface)
Finds a collection of service providers available for given service provider interface.
S - generic service typeserviceInterface - service provider interface