类 DataSourceUnwrapper
java.lang.Object
org.springframework.boot.jdbc.DataSourceUnwrapper
Unwraps a
DataSource that may have been proxied or wrapped in a custom
Wrapper such as DelegatingDataSource.- 从以下版本开始:
- 2.0.7
- 作者:
- Tadaya Tsuyukubo, Stephane Nicoll
-
方法概要
修饰符和类型方法说明static <I,T extends I>
Tunwrap(DataSource dataSource, Class<I> unwrapInterface, Class<T> target) Return an object that implements the giventargettype, unwrapping delegate or proxy if necessary using the specifiedunwrapInterface.static <T> Tunwrap(DataSource dataSource, Class<T> target) Return an object that implements the giventargettype, unwrapping delegate or proxy if necessary.
-
方法详细资料
-
unwrap
public static <I,T extends I> T unwrap(DataSource dataSource, Class<I> unwrapInterface, Class<T> target) Return an object that implements the giventargettype, unwrapping delegate or proxy if necessary using the specifiedunwrapInterface.- 类型参数:
I- the interface that the target type must implementT- the target type- 参数:
dataSource- the datasource to handleunwrapInterface- the interface that the target type must implementtarget- the type that the result must implement- 返回:
- an object that implements the target type or
null - 从以下版本开始:
- 2.3.8
- 另请参阅:
-
unwrap
Return an object that implements the giventargettype, unwrapping delegate or proxy if necessary. Consider usingunwrap(DataSource, Class, Class)asunwrappingwon't be considered iftargetis not an interface.- 类型参数:
T- the target type- 参数:
dataSource- the datasource to handletarget- the type that the result must implement- 返回:
- an object that implements the target type or
null
-