public abstract class ResourceLoader extends Object
Defines a general access point of loading any text resources and services.
| Modifier and Type | Field and Description |
|---|---|
static 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 InputStream |
load(URI uri,
boolean noCache)
Loads given resource as input stream.
|
abstract URI |
locate(String moduleName,
Class<?> moduleRef,
String path)
Constructs an URI for given module resource.
|
abstract <S> Iterable<S> |
services(Class<S> serviceInterface)
Finds a collection of service providers available for given service provider interface.
|
public static final 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 URI locate(String moduleName, Class<?> moduleRef, 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 InputStream load(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> Iterable<S> services(Class<S> serviceInterface)
Finds a collection of service providers available for given service provider interface.
S - generic service typeserviceInterface - service provider interfaceCopyright © 2014–2015. All rights reserved.