Interface ContextProvider
-
- All Implemented Interfaces:
public interface ContextProviderProvides objects from the platform context for injection into action methods.
This interface abstracts the mechanism for retrieving platform-managed objects (such as Spring beans) so that the core framework remains runtime-agnostic.
-
-
Method Summary
Modifier and Type Method Description abstract <T extends Any> TgetFromContext(Class<T> type)Retrieve an object of the specified type from the context. abstract BooleanhasInContext(Class<?> type)Check if an object of the specified type is available in the context. -
-
Method Detail
-
getFromContext
abstract <T extends Any> T getFromContext(Class<T> type)
Retrieve an object of the specified type from the context.
- Parameters:
type- the class of the object to retrieve- Returns:
the object instance, or null if not available
-
hasInContext
abstract Boolean hasInContext(Class<?> type)
Check if an object of the specified type is available in the context.
- Parameters:
type- the class to check for- Returns:
true if an object of this type can be provided
-
-
-
-