public interface Adaptable
Adaptable objects lets you add interfaces to a class and lets clients query whether an object has a particular extension. This means adaptable objects can be dynamically extended. Adapters are created by adapter factories, which are registered with an global adapter manager.
Adaptable a = ...; MyExtension x = a.getAdapter( MyExtension.class ); if( x != null ) { // invoke MyExtension methods on x ... }
Modifier and Type | Method and Description |
---|---|
<T> T |
getAdapter(java.lang.Class<T> adapter)
Returns an object which is an instance of the given class parameter
associated with this object or
null if no association
exists. |
<T> T getAdapter(java.lang.Class<T> adapter)
Returns an object which is an instance of the given class parameter
associated with this object or null
if no association
exists.
adapter
- the lookup classnull
if
there is no adapter associated with the given class.
Copyright (c) EclipseSource and others 2002, 2017.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0