public interface Heap
Heaplet
objects. A heap object may be lazily initialized, meaning that it or its dependencies
may not be created until first requested from the heap.Modifier and Type | Method and Description |
---|---|
<T> T |
get(String name,
Class<T> type)
Returns an object from the heap with a specified name, or
null if no such object exists. |
<T> List<T> |
getAll(Class<T> type)
Deprecated.
marked in 6.5 with no functional equivalent
|
Name |
getName()
Returns the name of this heap.
|
Bindings |
getProperties()
Returns the properties from this heap and its parents if any.
|
<T> T |
resolve(JsonValue reference,
Class<T> type)
Resolves a mandatory object with the specified reference.
|
<T> T |
resolve(JsonValue reference,
Class<T> type,
boolean optional)
Resolves an object with the specified reference, optionally or not.
|
Name getName()
<T> T get(String name, Class<T> type) throws HeapException
null
if no such object exists.T
- expected type of the heap objectname
- the name of the object in the heap to be retrieved.type
- expected type of the heap objectnull
if no such object exists.HeapException
- if an exception occurred during creation of the heap object or any of its dependencies.JsonValueException
- if a heaplet (or one of its dependencies) has a malformed configuration object.@Deprecated <T> List<T> getAll(Class<T> type) throws HeapException
T
- expected type of the heap objecttype
- expected type to search for in the heap or its parent (if
any).HeapException
- if an exception occurred during the creation of a heap object
or any of its dependencies.JsonValueException
- if a heaplet (or one of its dependencies) has a malformed
configuration object.<T> T resolve(JsonValue reference, Class<T> type) throws HeapException
JsonValueException
is thrown. If the reference is an inline object
declaration, an anonymous object is added to the heap and returned.
Equivalent to:
heap.resolve(reference, type, false);
T
- expected instance typereference
- a JSON value containing the name of the heap object to retrieve.type
- the expected type of the heap object.HeapException
- if there was an exception creating the heap object or any of its dependencies.JsonValueException
- if the name contains null
, is not a string, or the specified heap object could not be retrieved
or has the wrong type or the reference is not a valid inline declaration.<T> T resolve(JsonValue reference, Class<T> type, boolean optional) throws HeapException
JsonValueException
is thrown.T
- expected instance typereference
- a JSON value containing either the name of the heap object to retrieve or an inline declaration.type
- the expected type of the heap object.optional
- Accept or not a JsonValue that contains null.null
if name contains null
.HeapException
- if there was an exception creating the heap object or any of its dependencies.JsonValueException
- if the reference is not a string, or the specified heap object has the wrong type or the reference is not
a valid inline declaration.Bindings getProperties()
Copyright 2011-2017 ForgeRock AS.