public final class DataSourceUnwrapper
extends java.lang.Object
DataSource
that may have been proxied or wrapped in a custom
Wrapper
such as DelegatingDataSource
.Modifier and Type | Method and Description |
---|---|
static <I,T extends I> |
unwrap(javax.sql.DataSource dataSource,
java.lang.Class<I> unwrapInterface,
java.lang.Class<T> target)
Return an object that implements the given
target type, unwrapping delegate
or proxy if necessary using the specified unwrapInterface . |
static <T> T |
unwrap(javax.sql.DataSource dataSource,
java.lang.Class<T> target)
Return an object that implements the given
target type, unwrapping delegate
or proxy if necessary. |
public static <I,T extends I> T unwrap(javax.sql.DataSource dataSource, java.lang.Class<I> unwrapInterface, java.lang.Class<T> target)
target
type, unwrapping delegate
or proxy if necessary using the specified unwrapInterface
.I
- the interface that the target type must implementT
- the target typedataSource
- the datasource to handleunwrapInterface
- the interface that the target type must implementtarget
- the type that the result must implementnull
Wrapper.unwrap(Class)
public static <T> T unwrap(javax.sql.DataSource dataSource, java.lang.Class<T> target)
target
type, unwrapping delegate
or proxy if necessary. Consider using unwrap(DataSource, Class, Class)
as
unwrapping
won't be considered if target
is
not an interface.T
- the target typedataSource
- the datasource to handletarget
- the type that the result must implementnull