Package ca.uhn.fhir.util.adapters
package ca.uhn.fhir.util.adapters
Implements the Adapter pattern to allow external classes to extend/adapt existing classes.
Useful for extending interfaces that are closed to modification, or restricted for classpath reasons.
For clients, the main entry point is AdapterUtils.adapt(java.lang.Object, java.lang.Class)
which will attempt to cast to the target type, or build an adapter of the target type.
For implementors, you can support adaptation via two mechanisms:
- by implementing
IAdaptable
directly on a class to provide supported adapters, - or when the class is closed to direct modification, you can implement
an instance of
IAdapterFactory
and register it with the publicAdapterManager.INSTANCE
.
-
ClassDescriptionGeneric version of Eclipse IAdaptable interface.Interface for external service that builds adaptors for targets.Get an adaptor