public final class BridgeAdaptorUtils extends Object
IgnoreAnalyzerBridge
) or when trying to make use of specific field
interfaces (e.g. TwoWayStringBridge
).Modifier and Type | Method and Description |
---|---|
static <T> T |
unwrapAdaptorAndContainer(Object bridge,
Class<T> clazz)
Return a bridge of the specified type extracted from the given bridge,
going through
adaptors and container bridges
as necessary. |
static <T> T |
unwrapAdaptorOnly(Object bridge,
Class<T> clazz)
Return a bridge of the specified type extracted from the given bridge,
going through
adaptors as necessary, never going
through container bridges . |
public static <T> T unwrapAdaptorAndContainer(Object bridge, Class<T> clazz)
adaptors
and container bridges
as necessary.
The returned object may be the adaptor itself, or its delegate, or a delegate of
its delegate, and so on, but it may also be a element bridge of the given bridge if the
given bridge is a ContainerBridge
, or an element bridge of a delegate of the given
bridge, and so on.
If neither the adaptor nor one of its delegates can provide an instance of the
specified type, null
is returned.
bridge
- The bridge to use as a starting point.clazz
- The expected bridge type.null
if none could be found.public static <T> T unwrapAdaptorOnly(Object bridge, Class<T> clazz)
adaptors
as necessary, never going
through container bridges
.
The returned object may be the adaptor itself, or its delegate, or a delegate of its delegate, and so on.
If neither the adaptor or one of its delegates is an instance of the specified type,
null
is returned.
bridge
- The bridge to use as a starting point.clazz
- The expected bridge type.null
if none could be found.Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved