public abstract class BaseWrapperFactory extends Object implements WrapperFactory
(for each X, Y)( factory.wrap(X) == factory.wrap(X) <=> X == Y)
| Constructor and Description |
|---|
BaseWrapperFactory() |
| Modifier and Type | Method and Description |
|---|---|
<A> void |
bind(Wrapper<A> wrapper)
This method binds an already built wrapper for a wrapped object that has not been used in this factory.
|
void |
destroy()
Make sure this method is the last method called on a factory instance.
|
protected abstract Class<? extends Wrapper> |
getMappedClass(Class<?> original)
This method maps a class to wrap to the corresponding wrapper class
|
<A> Wrapper<A> |
wrap(A toWrap) |
<A> List<Wrapper<A>> |
wrap(Collection<A> toWrap) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPropertypublic BaseWrapperFactory()
public final <A> Wrapper<A> wrap(A toWrap) throws IllegalArgumentException
wrap in interface WrapperFactorytoWrap - could be nullIllegalArgumentException - when there is no wrapper class corresponding to the class of toWrappublic final <A> List<Wrapper<A>> wrap(Collection<A> toWrap) throws IllegalArgumentException
wrap in interface WrapperFactorytoWrap - is a non-null collection of (any) objects to wrapIllegalArgumentException - when there is no wrapper class for an object to wrapwrap(Object)public final void destroy()
destroy in interface WrapperFactorypublic final <A> void bind(Wrapper<A> wrapper) throws IllegalArgumentException
bind in interface WrapperFactorywrapper - is a non-null wrapper objectIllegalArgumentException - when there is already a wrapper registered for wrapper.getWrapped()protected abstract Class<? extends Wrapper> getMappedClass(Class<?> original)
original - is a non-null class to wrapCopyright © 2001–2018 MDA Tools. All rights reserved.