public abstract class RenderUnit<MOUNT_CONTENT> extends java.lang.Object implements Copyable
A RenderUnit should in most cases declare how it intends to bind data returning Binders from its mountUnmountFunctions callback or from the attachDetachFunctions callback.
Immutability: RenderUnits should be immutable! Continuing to change them after they are built and given to RenderCore (e.g. via RenderState) is not safe.
Modifier and Type | Class and Description |
---|---|
static interface |
RenderUnit.Binder<MODEL,CONTENT>
Represents a single bind function.
|
static class |
RenderUnit.Extension<MODEL,CONTENT>
An Extension is a pair of data Model and
RenderUnit.Binder . |
static class |
RenderUnit.RenderType |
Constructor and Description |
---|
RenderUnit(RenderUnit.RenderType renderType) |
RenderUnit(RenderUnit.RenderType renderType,
java.util.List<RenderUnit.Extension<?,? super MOUNT_CONTENT>> mountUnmountExtensions) |
RenderUnit(RenderUnit.RenderType renderType,
java.util.List<RenderUnit.Extension<?,? super MOUNT_CONTENT>> mountUnmountExtensions,
java.util.List<RenderUnit.Extension<?,? super MOUNT_CONTENT>> attachDetachExtensions) |
Modifier and Type | Method and Description |
---|---|
void |
addAttachDetachExtension(RenderUnit.Extension<?,? super MOUNT_CONTENT> extension)
Adds an
RenderUnit.Extension that will be invoked with the other attach/detach binders. |
void |
addAttachDetachExtensions(RenderUnit.Extension<?,? super MOUNT_CONTENT>... extensions)
Adds an
RenderUnit.Extension s that will be invoked with the other attach/detach binders. |
void |
addMountUnmountExtension(RenderUnit.Extension<?,? super MOUNT_CONTENT> extension)
Adds an
RenderUnit.Extension that will be invoked with the other mount/unmount binders. |
void |
addMountUnmountExtensions(RenderUnit.Extension<?,? super MOUNT_CONTENT>... extensions)
Adds
RenderUnit.Extension s that will be invoked with the other mount/unmount binders. |
abstract MOUNT_CONTENT |
createContent(Context c) |
protected java.lang.Class |
getDescription() |
abstract long |
getId() |
java.lang.Object |
getRenderContentType() |
RenderUnit.RenderType |
getRenderType() |
RenderUnit |
makeCopy() |
void |
unmountExtensions(Context context,
MOUNT_CONTENT content,
java.lang.Object layoutData)
Unbind all mountUnmount extension functions.
|
public RenderUnit(RenderUnit.RenderType renderType)
public RenderUnit(RenderUnit.RenderType renderType, java.util.List<RenderUnit.Extension<?,? super MOUNT_CONTENT>> mountUnmountExtensions)
public RenderUnit(RenderUnit.RenderType renderType, java.util.List<RenderUnit.Extension<?,? super MOUNT_CONTENT>> mountUnmountExtensions, java.util.List<RenderUnit.Extension<?,? super MOUNT_CONTENT>> attachDetachExtensions)
public RenderUnit.RenderType getRenderType()
public abstract MOUNT_CONTENT createContent(Context c)
public abstract long getId()
public java.lang.Object getRenderContentType()
protected java.lang.Class getDescription()
public RenderUnit makeCopy()
public void addMountUnmountExtension(RenderUnit.Extension<?,? super MOUNT_CONTENT> extension)
RenderUnit.Extension
that will be invoked with the other mount/unmount binders. Can be
used to add generic functionality (e.g. accessibility) to a RenderUnit.
NB: This method should only be called while initially configuring the RenderUnit. See the class-level javadocs about immutability.
@SafeVarargs public final void addMountUnmountExtensions(RenderUnit.Extension<?,? super MOUNT_CONTENT>... extensions)
RenderUnit.Extension
s that will be invoked with the other mount/unmount binders. Can be used
to add generic functionality (e.g. accessibility) to a RenderUnit.
NB: This method should only be called while initially configuring the RenderUnit. See the class-level javadocs about immutability.
public void addAttachDetachExtension(RenderUnit.Extension<?,? super MOUNT_CONTENT> extension)
RenderUnit.Extension
that will be invoked with the other attach/detach binders. Can be
used to add generic functionality (e.g. Dynamic Props) to a RenderUnit
NB: This method should only be called while initially configuring the RenderUnit. See the class-level javadocs about immutability.
@SafeVarargs public final void addAttachDetachExtensions(RenderUnit.Extension<?,? super MOUNT_CONTENT>... extensions)
RenderUnit.Extension
s that will be invoked with the other attach/detach binders. Can be
used to add generic functionality (e.g. Dynamic Props) to a RenderUnit
NB: This method should only be called while initially configuring the RenderUnit. See the class-level javadocs about immutability.
public void unmountExtensions(Context context, MOUNT_CONTENT content, java.lang.Object layoutData)