|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pfsw.extender.ObjectExtender
public class ObjectExtender
This class provides various static methods for creation of "extended" objects and to add mix-ins.
Method Summary | ||
---|---|---|
static
|
createExtensibleObject(java.lang.Class<I> interfaceType,
java.lang.Class... interfaces)
Returns an object of the specified interface type that also implements the additional interfaces. |
|
static
|
createExtensibleObject(java.lang.Class<I> interfaceType,
java.lang.Object object)
Returns an extended object that implements the given interface and is based on the given object. |
|
static
|
createExtensibleObject(java.lang.Class<I> interfaceType,
java.lang.Object object,
java.lang.Class... additionalInterfaces)
Returns an extended object that implements the given interface and is based on the given object. |
|
static
|
extend(T objectToExtend,
java.lang.String extensionName,
java.lang.Object extension)
Extends the given objectToExtend with the specified extension it it is associated with an ExtendedObject. |
|
static ExtendedObject |
getExtensionHandlerOf(java.lang.Object object)
Returns the ExtendedObject that is attached to the given object or null if none is attached. |
|
static java.lang.Object |
getExtensionOf(java.lang.Object object,
java.lang.String extensionName)
Returns the named extension associated with the given object or null if there is none. |
|
static
|
getMixin(java.lang.Class<T> interfaceClass,
java.lang.Object object)
Returns the mix-in implementation that is associated with the given interface and attached to the provided object. |
|
static
|
makeExtensible(java.lang.Class<I> interfaceType,
I object,
java.lang.Class... interfaces)
Returns the given object enhanced by a change tracking mechanism. |
|
static
|
setMixinTo(java.lang.Object object,
java.lang.Class<I> interfaceType,
T mixin)
Sets the mix-in implementation of the specified interface to the provided object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <I> I makeExtensible(java.lang.Class<I> interfaceType, I object, java.lang.Class... interfaces)
interfaceType
- The interface the provided object must implementobject
- An object that should be enhanced by a change tracking mechanismpublic static <I> I createExtensibleObject(java.lang.Class<I> interfaceType, java.lang.Object object)
interfaceType
- The interface the extended object implements (must not be null)object
- The object to be extended (must not be null)public static <I> I createExtensibleObject(java.lang.Class<I> interfaceType, java.lang.Object object, java.lang.Class... additionalInterfaces)
interfaceType
- The interface the extended object implements (must not be null)object
- The object to be extended (must not be null)additionalInterfaces
- More interface that are not part of the return typepublic static <I> I createExtensibleObject(java.lang.Class<I> interfaceType, java.lang.Class... interfaces)
interfaceType
- The interface the provided object must implementinterfaces
- Optional additional interfacespublic static <T> T getMixin(java.lang.Class<T> interfaceClass, java.lang.Object object)
interfaceClass
- The interface of the mix-inobject
- The extended object that might contain the mix-inpublic static <I,T extends I> void setMixinTo(java.lang.Object object, java.lang.Class<I> interfaceType, T mixin)
public static ExtendedObject getExtensionHandlerOf(java.lang.Object object)
public static java.lang.Object getExtensionOf(java.lang.Object object, java.lang.String extensionName)
public static <T> T extend(T objectToExtend, java.lang.String extensionName, java.lang.Object extension)
objectToExtend
- The object to be extended (must not be null).extensionName
- The name of the extension (must not be null).extension
- The extension object (must not be null).
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |