|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.inria.ns.reflex.util.Registry
public class Registry
A Registry is a structure used to store typed resources.
Registries may be backed by another registry, that is to say when a resource is looked up, a chain of registry may be used to retrieve the resource. The lookup order (top-down or bottom-up) depends on the nature of the resource to research.
Several registries can be backed by the same single registry ; when one of them is involved, it can't access to other registries except to its parent : registries are organized in trees and browsed by branchs.
To retrieve a resource bound to a key, the key must be wrapped in a LookupKey.
| Constructor Summary | |
|---|---|
Registry()
Create a new registry backed by the static registry. |
|
Registry(Registry registry)
Create a new registry backed by a given registry. |
|
| Method Summary | |
|---|---|
Object |
get(Key key)
Return the object stored in this registry, without lookup in the back registries. |
Object |
getFromParent(Key key)
Return the object stored in the parent registry, if any. |
Object |
lookup(LookupKey lookupKey)
Looks up for a resource in this registry. |
void |
store(Key key,
Object resource)
Store a resource with a given key. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Registry()
public Registry(Registry registry)
registry - The registry that backs this one.| Method Detail |
|---|
public void store(Key key,
Object resource)
key - The key with which the resource is stored.
To retrieve the resource, this key must be wrapped
in a LookupKey.resource - The resource to store.LookupKey,
lookup(LookupKey)public Object lookup(LookupKey lookupKey)
lookupKey - The lookup key, that embeds in itself the lookup method
and the real key with which the resource is stored.
public Object get(Key key)
key - The key of the object to find.
public Object getFromParent(Key key)
key - The key of the object to find.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||