public class DefaultResultAdapterContext extends Object implements ResultAdapterContext
| Constructor and Description |
|---|
DefaultResultAdapterContext()
Instantiates the context and registers all the default adapters.
|
DefaultResultAdapterContext(boolean registerDefaults)
Instantiates the context
|
| Modifier and Type | Method and Description |
|---|---|
Object |
adapt(Invocation invocation,
Object originalResult)
Will call the registered result adapters to adapt the results to the required type.
|
Collection<ResultAdapter<?>> |
getAdapters() |
void |
register(ResultAdapter<?> adapter)
Registers a new result adapter with this context
|
public DefaultResultAdapterContext()
public DefaultResultAdapterContext(boolean registerDefaults)
registerDefaults - whether default adapters should be registered by default.public void register(ResultAdapter<?> adapter)
ResultAdapterContextregister in interface ResultAdapterContextadapter - the adapterpublic Object adapt(Invocation invocation, Object originalResult)
ResultAdapterContextadapt in interface ResultAdapterContextinvocation - the invocation for which we are adapting the resultsoriginalResult - the original result from the data store operationpublic Collection<ResultAdapter<?>> getAdapters()
getAdapters in interface ResultAdapterContextCopyright © 2014–2016. All rights reserved.