Package org.zkoss.clientbind
Class ClientBindComposer<T extends Component>
java.lang.Object
org.zkoss.clientbind.ClientBindComposer<T>
- All Implemented Interfaces:
Serializable,AuService,ComponentActivationListener,Composer<T>,ComposerExt<T>
public class ClientBindComposer<T extends Component>
extends Object
implements Composer<T>, ComposerExt<T>, Serializable, AuService, ComponentActivationListener
- Author:
- jumperchen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final org.slf4j.Loggerprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConverter(String name, Converter converter) protected voidprotected ObjectcoerceToBeanProp(Object bean, String prop, Object value) voiddidActivate(Component comp) Called when a session has just been activated (and its value has been deserialized).voiddoAfterCompose(T comp) Invokes after ZK loader creates this component, initializes it and composes all its children, if any.doBeforeCompose(Page page, Component component, ComponentInfo componentInfo) Invokes before composing a component.voiddoBeforeComposeChildren(T comp) Invokes after the component is instantiated and initialized, but before composing any child.protected voiddoBeforeComposeChildren0(T comp, Object vmObject) booleanCalled when an exception occurs when composing the component.protected ObjectdoConvertCoerceToBean(Object origin, Component comp, String converterExpr, Map<String, Object> coverterParams) voidCalled after the component has been composed completely.protected booleandoValidate(Map<String, Object> validatorData, Map<String, Object> validatorProperty, Object bean, Component comp, String prop, Object value) protected ObjectevalExpression(Component target, String expression) protected ConverterfindConverter(Component target, String expr) getBeanUid(Object bean) protected ObjectvoidhandleModel(Map<String, Object> allBindings, Component comp, String expr, Map<String, String[]> converterInfo) protected voidprotected ObjectinitInnerViewModel(BindEvaluatorX evalx, Component comp, String vmname, Object vm) voidprotected BindContextprepareConverterContext(Component target, Map<String, Object> paramsFromClient) static voidprocessPropertyBinding(Map<String, Object> allBindings, String prop, String annot, Map<String, String[]> propertyBinding) Internal used onlystatic voidprocessPropertyBinding(Map<String, Object> allBindings, String prop, String annot, Map<String, String[]> propertyBinding, boolean multiple) Internal used onlyvoidrenderProperties(ContentRenderer contentRenderer) booleanHandles an AU request.voidsetCachedBeanById(String id, Object data) protected voidsetCachedFormBeanById(String id, Object data) protected voidvoidwillPassivate(Component comp) Called when a session is about to be passivated (and then serialize its value).
-
Field Details
-
log
protected static final org.slf4j.Logger log -
VM_ID
- See Also:
-
BINDER_ID
- See Also:
-
VALIDATION_MESSAGE_ID
- See Also:
-
ID_ANNO
- See Also:
-
INIT_ANNO
- See Also:
-
VALUE_ANNO_ATTR
- See Also:
-
FORM_ATTR
- See Also:
-
VIEW_MODEL_ATTR
- See Also:
-
BINDER_ATTR
- See Also:
-
VALIDATION_MESSAGES_ATTR
- See Also:
-
CHILDREN_ATTR
- See Also:
-
MODEL_ATTR
- See Also:
-
QUEUE_NAME_ANNO_ATTR
- See Also:
-
QUEUE_SCOPE_ANNO_ATTR
- See Also:
-
UPDATE_BINDING_CMD
- See Also:
-
UPDATE_BINDING_DATA
- See Also:
-
UPDATE_SELECTION_DATA
- See Also:
-
VALIDATE_BINDING_CMD
- See Also:
-
VALIDATE_BINDING_DATA
- See Also:
-
VALIDATE_BINDING_PROPERTY
- See Also:
-
VALIDATE_BINDING_COMPONENT_PROPERTY
- See Also:
-
VALIDATE_SAVE_FORM_BINDING
- See Also:
-
REMOTE_EL_CMD
- See Also:
-
REMOTE_CONVERTER_CMD
- See Also:
-
REMOTE_CMD_ARG
- See Also:
-
FORM_SAVE_CMD
- See Also:
-
FETCH_BEAN_DATA_CMD
- See Also:
-
REMOTE_CLEAR_VALIDATION_MESSAGE_CMD
- See Also:
-
TREEITEM_OPEN_CMD
- See Also:
-
GROUP_OPEN_CMD
- See Also:
-
TREE_MODEL_SELECTION_CMD
- See Also:
-
LIST_MODEL_SELECTION_CMD
- See Also:
-
LIST_SUBMODEL_CMD
- See Also:
-
LIST_SUBMODEL_SELECTION_CMD
- See Also:
-
BEAN_UID
- See Also:
-
IMMUTABLE
- See Also:
-
TO_STRING_CONVERTER
- See Also:
-
CLIENT_BINDINGS
- See Also:
-
ROD_SIZE
- See Also:
-
COMMAND_EVENT
- See Also:
-
COMMAND_TRACKING_ARGUMENTS
- See Also:
-
COMMAND_TRACKING_ARGUMENTS_CHANGES
- See Also:
-
WRAPPED_TYPE
- See Also:
-
WRAPPED_RAW_VALUE
- See Also:
-
WRAPPED_STRING_VALUE
- See Also:
-
WRAPPED_FORMAT_VALUE
- See Also:
-
LOCAL_DATE_POSTFIX
- See Also:
-
LOCAL_DATE_TIME_POSTFIX
- See Also:
-
LOCAL_TIME_POSTFIX
- See Also:
-
ZONED_DATE_TIME
- See Also:
-
DISABLE_CLIENT_UPDATE
- See Also:
-
RENDER_ALL_TREE_DATA
- See Also:
-
dependsOnMap
-
modelToListModel
-
modelToTreeModel
-
modelToStepModel
-
modelRodSizeMap
-
-
Constructor Details
-
ClientBindComposer
public ClientBindComposer() -
ClientBindComposer
public ClientBindComposer(boolean isClientWidgetOnly)
-
-
Method Details
-
getEvaluatorX
-
getBinder
-
getViewModel
-
addConverter
-
renderProperties
- Throws:
IOException
-
doAfterCompose
Description copied from interface:ComposerInvokes after ZK loader creates this component, initializes it and composes all its children, if any.- Specified by:
doAfterComposein interfaceComposer<T extends Component>- Parameters:
comp- the component has been composed- Throws:
Exception
-
traverseComponentBindings
-
processPropertyBinding
public static void processPropertyBinding(Map<String, Object> allBindings, String prop, String annot, Map<String, String[]> propertyBinding) Internal used only -
processPropertyBinding
public static void processPropertyBinding(Map<String, Object> allBindings, String prop, String annot, Map<String, String[]> propertyBinding, boolean multiple) Internal used only -
handleModel
-
notifyPropertyChange
-
doBeforeCompose
public ComponentInfo doBeforeCompose(Page page, Component component, ComponentInfo componentInfo) throws Exception Description copied from interface:ComposerExtInvokes before composing a component. If you want to manipulate the specified component info, you can useComponentInfo.duplicate()to make a copy and then modify it such that it won't affect the default behavior.- Specified by:
doBeforeComposein interfaceComposerExt<T extends Component>- Parameters:
page- the page for composing this component.component- the parent component, or null if it is the root component.componentInfo- the component info used to instantiate the component. Notice that it is null if the page is rendered as ZK JSP, sinceComponentInfois not available under ZK JSP.- Returns:
- the component info used to instantiate the component. In most case, it shall return compInfo. If null is returned, the component won't be instantiated. In other words, it is ignored.
- Throws:
Exception
-
doBeforeComposeChildren
Description copied from interface:ComposerExtInvokes after the component is instantiated and initialized, but before composing any child.- Specified by:
doBeforeComposeChildrenin interfaceComposerExt<T extends Component>- Parameters:
comp- the component being composed- Throws:
Exception
-
doBeforeComposeChildren0
- Throws:
Exception
-
initInnerViewModel
-
doCatch
Description copied from interface:ComposerExtCalled when an exception occurs when composing the component.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.
- Specified by:
doCatchin interfaceComposerExt<T extends Component>- Parameters:
throwable- the exception being thrown- Returns:
- whether to ignore the exception. If false is returned, the exception will be re-thrown. Note: once a composer's doCatch returns true, the exception will be ignored and it means doCatch of the following composers won't be called.
- Throws:
Exception
-
doFinally
Description copied from interface:ComposerExtCalled after the component has been composed completely. It is the last step of the composing.Note: it is always called even if
ComposerExt.doCatch(java.lang.Throwable),ComposerExt.doBeforeComposeChildren(T)orComposer.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.
- Specified by:
doFinallyin interfaceComposerExt<T extends Component>- Throws:
Exception
-
service
Description copied from interface:AuServiceHandles an AU request.- Specified by:
servicein interfaceAuService- Parameters:
request- the request sent from the client.everError- whether any error ever occurred before processing this request.- Returns:
- whether the request has been processed. If false is returned, the default process (handled by the component) will take place.
-
evalExpression
-
findConverter
-
prepareConverterContext
protected BindContext prepareConverterContext(Component target, Map<String, Object> paramsFromClient) -
doConvertCoerceToBean
-
coerceToBeanProp
-
doValidate
-
setCachedBeanById
-
getCachedFormBeanById
-
setCachedFormBeanById
-
clearCachedFormBeans
protected void clearCachedFormBeans() -
initCachedFormBeans
protected void initCachedFormBeans() -
getBeanUid
-
didActivate
Description copied from interface:ComponentActivationListenerCalled when a session has just been activated (and its value has been deserialized).- Specified by:
didActivatein interfaceComponentActivationListener
-
willPassivate
Description copied from interface:ComponentActivationListenerCalled when a session is about to be passivated (and then serialize its value).- Specified by:
willPassivatein interfaceComponentActivationListener
-