public abstract class NamedServicesProvider extends Object
Lookup.getDefault() is consulted when providing answers
to Lookups.forPath(java.lang.String) queries. Current implementation
is not ready for multiple instances of this interface (the first one wins)
and also changing the instances during runtime.
| Modifier | Constructor and Description |
|---|---|
protected |
NamedServicesProvider()
Throws an exception.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract Lookup |
create(String path)
Create the lookup for given path.
|
static Lookup |
createLookupFor(Object obj)
Allows the providers to donate a special lookup for a given object.
|
static Lookup |
forPath(String path) |
static <T> T |
getConfigObject(String filePath,
Class<T> type)
Finds a config object under given path.
|
protected Lookup |
lookupFor(Object obj)
Method for providers to work in orchestration with
createLookupFor(java.lang.Object). |
protected <T> T |
lookupObject(String path,
Class<T> type)
Finds a config object under given path.
|
protected NamedServicesProvider()
public static <T> T getConfigObject(String filePath, Class<T> type)
filePath - path to .instance or .settings filetype - the requested type for given objectpublic static Lookup createLookupFor(Object obj)
FileObject.getLookup.obj - the object to find lookup fornull or new lookup to be associated with the objprotected abstract Lookup create(String path)
Lookups.forPath(java.lang.String).path - the identification of the pathprotected <T> T lookupObject(String path, Class<T> type)
FileUtil#getConfigObject.filePath - path to .instance or .settings filetype - the requested type for given objectprotected Lookup lookupFor(Object obj)
createLookupFor(java.lang.Object).
By default return null.obj - the object to find lookup fornull or new lookup to be associated with the objCopyright © 2025 API Design. All Rights Reserved.