public class BindComposer<T extends Component> extends java.lang.Object implements Composer<T>, ComposerExt<T>, java.io.Serializable, AuService, ComponentActivationListener
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
BINDER_ATTR |
static java.lang.String |
BINDER_ID |
protected static java.lang.String |
ID_ANNO |
protected static java.lang.String |
INIT_ANNO |
protected static java.lang.String |
QUEUE_NAME_ANNO_ATTR |
protected static java.lang.String |
QUEUE_SCOPE_ANNO_ATTR |
protected static java.lang.String |
VALIDATION_MESSAGES_ATTR |
protected static java.lang.String |
VALUE_ANNO_ATTR |
protected static java.lang.String |
VIEW_MODEL_ATTR |
static java.lang.String |
VM_ID |
Constructor and Description |
---|
BindComposer() |
Modifier and Type | Method and Description |
---|---|
void |
addConverter(java.lang.String name,
Converter converter) |
void |
addValidator(java.lang.String name,
Validator validator) |
void |
didActivate(Component comp)
Called when a session has just been activated
(and its value has been deserialized).
|
void |
doAfterCompose(T comp)
Invokes after ZK loader creates this component,
initializes it and composes all its children, if any.
|
ComponentInfo |
doBeforeCompose(Page page,
Component parent,
ComponentInfo compInfo)
Invokes before composing a component.
|
void |
doBeforeComposeChildren(Component comp)
Invokes after the component is instantiated and initialized, but
before composing any child.
|
boolean |
doCatch(java.lang.Throwable ex)
Called when an exception occurs when composing the component.
|
void |
doFinally()
Called after the component has been composed completely.
|
Binder |
getBinder() |
Converter |
getConverter(java.lang.String name) |
Validator |
getValidator(java.lang.String name) |
java.lang.Object |
getViewModel() |
void |
notifyChange(java.lang.Object bean,
java.lang.String property) |
boolean |
service(AuRequest request,
boolean everError)
Handles an AU request.
|
void |
setViewModel(java.lang.Object viewModel) |
void |
willPassivate(Component comp)
Called when a session is about to be passivated
(and then serialize its value).
|
public static final java.lang.String VM_ID
public static final java.lang.String BINDER_ID
protected static final java.lang.String ID_ANNO
protected static final java.lang.String INIT_ANNO
protected static final java.lang.String VALUE_ANNO_ATTR
protected static final java.lang.String VIEW_MODEL_ATTR
protected static final java.lang.String BINDER_ATTR
protected static final java.lang.String VALIDATION_MESSAGES_ATTR
protected static final java.lang.String QUEUE_NAME_ANNO_ATTR
protected static final java.lang.String QUEUE_SCOPE_ANNO_ATTR
public Binder getBinder()
public void setViewModel(java.lang.Object viewModel)
public java.lang.Object getViewModel()
public Converter getConverter(java.lang.String name)
public Validator getValidator(java.lang.String name)
public void addConverter(java.lang.String name, Converter converter)
public void addValidator(java.lang.String name, Validator validator)
public ComponentInfo doBeforeCompose(Page page, Component parent, ComponentInfo compInfo) throws java.lang.Exception
ComposerExt
ComponentInfo.duplicate()
to make a copy and then
modify it such that it won't affect the default behavior.doBeforeCompose
in interface ComposerExt<T extends Component>
page
- the page for composing this component.parent
- the parent component, or null if it is the root component.compInfo
- the component info used to instantiate the component.
Notice that it is null if the page is rendered as ZK JSP, since
ComponentInfo
is not available under ZK JSP.java.lang.Exception
public void doBeforeComposeChildren(Component comp) throws java.lang.Exception
ComposerExt
doBeforeComposeChildren
in interface ComposerExt<T extends Component>
comp
- the component being composedjava.lang.Exception
public void doAfterCompose(T comp) throws java.lang.Exception
Composer
doAfterCompose
in interface Composer<T extends Component>
comp
- the component has been composedjava.lang.Exception
public boolean doCatch(java.lang.Throwable ex) throws java.lang.Exception
ComposerExt
If you don't want to handle the exception, simply returns false.
boolean doCatch(Throwable ex) {return false;}
An exception thrown in this method is simply logged. It has no effect on the execution. If you want to ignore the exception, just return true.
doCatch
in interface ComposerExt<T extends Component>
ex
- the exception being thrownjava.lang.Exception
public void doFinally() throws java.lang.Exception
ComposerExt
Note: it is always called even if ComposerExt.doCatch(java.lang.Throwable)
,
ComposerExt.doBeforeComposeChildren(T)
or
Composer.doAfterCompose(T)
is not called (due to exceptions).
Note: it is called after the onCreate event is posted, but before the onCreate and any other events are handled.
An exception thrown in this method is simply logged. It has no effect on the execution.
doFinally
in interface ComposerExt<T extends Component>
java.lang.Exception
public void notifyChange(java.lang.Object bean, java.lang.String property)
public void didActivate(Component comp)
ComponentActivationListener
didActivate
in interface ComponentActivationListener
public void willPassivate(Component comp)
ComponentActivationListener
willPassivate
in interface ComponentActivationListener
public boolean service(AuRequest request, boolean everError)
AuService
service
in interface AuService
request
- the request sent from the client.everError
- whether any error ever occurred before
processing this request.Copyright © 2005-2021 Potix Corporation. All Rights Reserved.