public class AbstractLookup extends Lookup implements Serializable
Serializable since 3.27.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractLookup.Content
A class that can be used by the creator of the
AbstractLookup to
control its content (a kind of
Privileged API
giving creator of the lookup more rights than subsequent users of the lookup). |
static class |
AbstractLookup.Pair<T>
Extension to the default lookup item that offers additional information
for the data structures use in AbstractLookup
|
Lookup.Item<T>, Lookup.Provider, Lookup.Result<T>, Lookup.Template<T>
Modifier | Constructor and Description |
---|---|
protected |
AbstractLookup()
Default constructor for subclasses that do not need to provide a content
|
|
AbstractLookup(AbstractLookup.Content content)
Constructor to create this lookup and associate it with given
Content.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addPair(AbstractLookup.Pair<?> pair)
The method to add instance to the lookup with.
|
protected void |
addPair(AbstractLookup.Pair<?> pair,
Executor notifyIn)
The method to add instance to the lookup with.
|
protected void |
beforeLookup(Lookup.Template<?> template)
Notifies subclasses that a query is about to be processed.
|
protected void |
initialize()
Method for subclasses to initialize them selves.
|
<T> T |
lookup(Class<T> clazz)
Look up an object matching a given interface.
|
<T> Lookup.Result<T> |
lookup(Lookup.Template<T> template)
The general lookup method.
|
<T> Lookup.Item<T> |
lookupItem(Lookup.Template<T> template)
Look up the first item matching a given template.
|
protected void |
removePair(AbstractLookup.Pair<?> pair)
Remove instance.
|
protected void |
removePair(AbstractLookup.Pair<?> pair,
Executor notifyIn)
Remove instance.
|
protected void |
setPairs(Collection<? extends AbstractLookup.Pair> collection)
Changes all pairs in the lookup to new values.
|
protected void |
setPairs(Collection<? extends AbstractLookup.Pair> collection,
Executor notifyIn)
Changes all pairs in the lookup to new values, notifies listeners
using provided executor.
|
String |
toString() |
getDefault, lookupAll, lookupResult
public AbstractLookup(AbstractLookup.Content content)
content
- the content to assciate withprotected AbstractLookup()
protected void initialize()
protected void beforeLookup(Lookup.Template<?> template)
template
- the templateprotected final void addPair(AbstractLookup.Pair<?> pair)
pair
- class/instance pairprotected final void addPair(AbstractLookup.Pair<?> pair, Executor notifyIn)
pair
- class/instance pairnotifyIn
- the executor that will handle the notification of eventsprotected final void removePair(AbstractLookup.Pair<?> pair)
pair
- class/instance pairprotected final void removePair(AbstractLookup.Pair<?> pair, Executor notifyIn)
pair
- class/instance pairnotifyIn
- the executor that will handle the notification of eventsprotected final void setPairs(Collection<? extends AbstractLookup.Pair> collection)
collection
- the collection of (Pair) objectsprotected final void setPairs(Collection<? extends AbstractLookup.Pair> collection, Executor notifyIn)
collection
- the collection of (Pair) objectsnotifyIn
- the executor that will handle the notification of eventspublic final <T> T lookup(Class<T> clazz)
Lookup
public final <T> Lookup.Item<T> lookupItem(Lookup.Template<T> template)
Lookup
lookupItem
in class Lookup
template
- the template to checknull
public final <T> Lookup.Result<T> lookup(Lookup.Template<T> template)
Lookup
template
, request more info about
them in form of Lookup.Item
and attach a listener to
this be notified about changes. The general interface does not
specify whether subsequent calls with the same template produce new
instance of the Lookup.Result
or return shared instance. The
prefered behaviour however is to return shared one.Built on June 4 2024. | Copyright © 2017-2024 Apache Software Foundation. All Rights Reserved.