Package org.zkoss.bind.impl
Class BinderImpl
- java.lang.Object
-
- org.zkoss.bind.impl.BinderImpl
-
- All Implemented Interfaces:
java.io.Serializable,Binder,BinderCtrl
- Direct Known Subclasses:
AnnotateBinder,DefaultBinder
public class BinderImpl extends java.lang.Object implements Binder, BinderCtrl, java.io.Serializable
Implementation of Binder.- Since:
- 6.0.0
- Author:
- henrichen, dennischen
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDISABLE_METHOD_CACHEstatic java.lang.StringZKFORMPROXYNOTIFIEDKEY-
Fields inherited from interface org.zkoss.bind.Binder
ACCESS, COMMAND_FAIL_VALIDATE, COMMAND_SUCCESS, CONVERTER, LOAD_EVENT, LOAD_REPLACEMENT, LOAD_TYPE, RENDERER, SAVE_EVENT, SAVE_REPLACEMENT, VALIDATOR, ZKBIND
-
Fields inherited from interface org.zkoss.bind.sys.BinderCtrl
ACTIVATOR, BINDCTX, BINDER, BINDING, BINDRENDERING, CHILDREN_ATTR, CHILDREN_BINDING_MODEL, CHILDREN_BINDING_MODEL_LISTENER, CHILDREN_BINDING_RENDERED_COMPONENTS, CLIENT_INFO, CLIENT_UPLOAD_INFO, DEFAULT_QUEUE_NAME, DEFAULT_QUEUE_SCOPE, DEPENDS_ON_COMP, FORM_ID, IGNORE_REF_VALUE, IGNORE_TRACKER, INVALIDATE_REF_VALUE, IS_TEMPLATE_MODEL_ENABLED_ATTR, LOAD_FORM_COMPONENT, LOAD_FORM_EXPRESSION, MATCHMEDIAVALUE_PREFIX, MODEL, NOTIFYS, ON_BIND_CLEAN, ON_BIND_INIT, PHASE_LISTENER_CLASS_KEY, REMOVE_BINDINGS, RENDERER_INSTALLED, SAVE_BASE, SRCPATH, VALIDATES, VAR, VIEWMODELID_BINDER_MAP_KEY, VM
-
-
Constructor Summary
Constructors Constructor Description BinderImpl()BinderImpl(java.lang.String qname, java.lang.String qscope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildrenInitBinding(org.zkoss.zk.ui.Component comp, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> initArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)init children of a component by an expression, it only execute oncevoidaddChildrenLoadBindings(org.zkoss.zk.ui.Component comp, java.lang.String loadExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Add new children-load-bindings.voidaddCommandBinding(org.zkoss.zk.ui.Component comp, java.lang.String evtnm, java.lang.String commandExpr, java.util.Map<java.lang.String,java.lang.Object> args)Add a new command binding.voidaddFormAssociatedSaveBinding(org.zkoss.zk.ui.Component associatedComp, java.lang.String formId, SaveBinding saveBinding, java.lang.String fieldName)Add a association between formId and a associated save binding(save binding inside a form), the form has to exist in the parent componentsvoidaddFormInitBinding(org.zkoss.zk.ui.Component comp, java.lang.String id, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> initArgs)init a component form by expression, it only execute oncevoidaddFormLoadBindings(org.zkoss.zk.ui.Component comp, java.lang.String id, java.lang.String loadExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)Add new form-load-bindings.voidaddFormSaveBindings(org.zkoss.zk.ui.Component comp, java.lang.String id, java.lang.String saveExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String validatorExpr, java.util.Map<java.lang.String,java.lang.Object> validatorArgs)Add new form-save-bindings.voidaddGlobalCommandBinding(org.zkoss.zk.ui.Component comp, java.lang.String evtnm, java.lang.String commandExpr, java.util.Map<java.lang.String,java.lang.Object> args)Add a new global-command binding.voidaddPhaseListener(PhaseListener listener)Add thePhaseListenervoidaddPropertyInitBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> initArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)init a component property by a expression, it only execute oncevoidaddPropertyLoadBindings(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String loadExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Add new property-load-bindings.voidaddPropertySaveBindings(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String saveExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs, java.lang.String validatorExpr, java.util.Map<java.lang.String,java.lang.Object> validatorArgs)Add new property-save-bindings.voidaddReferenceBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String loadExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)Add a new reference-binding.voidaddSaveFormFieldName(Form form, java.lang.String fieldName)Adds a field name for saving with the given Form.voidaddSaveFormFieldName(Form form, java.util.Set<java.lang.String> fieldNames)Adds all field names for saving with the given Form.protected voidcheckInit()protected ParamCallcreateParamCall(BindContext ctx)voiddestroy(org.zkoss.zk.ui.Component comp, java.lang.Object viewModel)Destroys the binder with a root component and viewModel object.protected voiddoExecute(org.zkoss.zk.ui.Component comp, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> commandArgs, BindContext ctx, java.util.Set<Property> notifys)protected voiddoLoadAfter(org.zkoss.zk.ui.Component comp, java.lang.String command, BindContext ctx)protected voiddoLoadBefore(org.zkoss.zk.ui.Component comp, java.lang.String command, BindContext ctx)protected voiddoSaveAfter(org.zkoss.zk.ui.Component comp, java.lang.String command, org.zkoss.zk.ui.event.Event evt, BindContext ctx, java.util.Set<Property> notifys)protected voiddoSaveBefore(org.zkoss.zk.ui.Component comp, java.lang.String command, org.zkoss.zk.ui.event.Event evt, BindContext ctx, java.util.Set<Property> notifys)protected booleandoValidate(org.zkoss.zk.ui.Component comp, java.lang.String command, org.zkoss.zk.ui.event.Event evt, BindContext ctx, java.util.Set<Property> notifys)protected voidfireNotifyChanges(java.util.Set<Property> notifys)BindingAnnotationInfoCheckergetBindingAnnotationInfoChecker()get binding annotation info checkerBindingExecutionInfoCollectorgetBindingExecutionInfoCollector()get binding execution info collectorjava.util.Map<java.lang.String,java.util.List<Binding>>getBindings(org.zkoss.zk.ui.Component comp)ConvertergetConverter(java.lang.String name)Returns the _converter of the given _converter name.java.util.Map<java.lang.String,java.lang.Object>getDynamicAttrs()Internal use only.BindEvaluatorXgetEvaluatorX()Returns theBindEvaluatorXused by this Binder.protected org.zkoss.zk.ui.event.EventQueue<org.zkoss.zk.ui.event.Event>getEventQueue()FormgetForm(org.zkoss.zk.ui.Component comp, java.lang.String id)Get the form of the componentjava.util.Set<SaveBinding>getFormAssociatedSaveBindings(org.zkoss.zk.ui.Component comp)Get associated save bindings of a form in a componentjava.util.List<Binding>getLoadPromptBindings(org.zkoss.zk.ui.Component comp, java.lang.String attr)get all load prompt binding of the component and attributejava.util.Map<java.lang.String,java.lang.reflect.Method>getMatchMediaValue()Returns an unmodifiable Map containing all the MatchMedia annotation values of this binder.PhaseListenergetPhaseListener()java.util.List<PhaseListener>getPhaseListeners()get the firstPhaseListenerjava.lang.StringgetQueueName()Returns the queue name of this binderjava.lang.StringgetQueueScope()Returns the queue scope of this binderprotected java.lang.ObjectgetRenderer(java.lang.String name)java.util.Set<java.lang.String>getSaveFormFieldNames(Form form)Returns all field names for saving with the given Form.TemplateResolvergetTemplateResolver(org.zkoss.zk.ui.Component comp, java.lang.String attr)get the template resolver that sets byBinder.setTemplate(Component, String, String, java.util.Map)TrackergetTracker()Returns associated dependency tracker of this binder.ValidationMessagesgetValidationMessages()Get theValidationMessagesValidatorgetValidator(java.lang.String name)Returns the _validator of the given _validator name.org.zkoss.zk.ui.ComponentgetView()Returns associated root component of this binder.java.lang.ObjectgetViewModel()Returns associated ViewModel of this binder.booleanhasValidator(org.zkoss.zk.ui.Component comp, java.lang.String attr)is there a validator on the attribute of componentvoidinit(org.zkoss.zk.ui.Component comp, java.lang.Object viewModel, java.util.Map<java.lang.String,java.lang.Object> initArgs)Initializes the binder with a root component and viewModel object.voidinitActivator()Internal use only.voidinitQueue()Internal use only.booleanisActivating()check if binder is in activating statevoidloadComponent(org.zkoss.zk.ui.Component comp, boolean loadinit)Internal Use only. init and load the componentprotected voidloadComponent0(org.zkoss.zk.ui.Component comp, boolean loadinit)protected CommandBindingnewCommandBinding(org.zkoss.zk.ui.Component comp, java.lang.String evtnm, java.lang.String cmdScript, java.util.Map<java.lang.String,java.lang.Object> args)Make this extenable.protected InitChildrenBindingnewInitChildrenBinding(org.zkoss.zk.ui.Component comp, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Make this extenable.protected InitFormBindingnewInitFormBinding(org.zkoss.zk.ui.Component comp, java.lang.String formId, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)Make this extenable.protected InitPropertyBindingnewInitPropertyBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String loadAttr, java.lang.Class<?> attrType, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Make this extenable.protected LoadChildrenBindingnewLoadChildrenBinding(org.zkoss.zk.ui.Component comp, java.lang.String loadExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Make this extenable.protected LoadFormBindingnewLoadFormBinding(org.zkoss.zk.ui.Component comp, java.lang.String formId, java.lang.String loadExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)Make this extenable.protected LoadPropertyBindingnewLoadPropertyBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String loadAttr, java.lang.Class<?> attrType, java.lang.String loadExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Make this extenable.protected SaveFormBindingnewSaveFormBinding(org.zkoss.zk.ui.Component comp, java.lang.String formId, java.lang.String saveExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String validatorExpr, java.util.Map<java.lang.String,java.lang.Object> validatorArgs)Make this extenable.protected SavePropertyBindingnewSavePropertyBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String saveAttr, java.lang.String saveExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs, java.lang.String validatorExpr, java.util.Map<java.lang.String,java.lang.Object> validatorArgs)Make this extenable.voidnotifyChange(java.lang.Object base, java.lang.String attr)Notify change of the property.voidpostCommand(java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> args)post command this binder, binder will queue the command, and fired later.voidremoveBindings(java.util.Set<org.zkoss.zk.ui.Component> comps)Remove all managed bindings that associated with the specified components.voidremoveBindings(org.zkoss.zk.ui.Component comp)Remove all bindings that associated with the specified component.voidremoveBindings(org.zkoss.zk.ui.Component comp, java.lang.String key)Remove all bindings that associated with the specified component and key (_fieldExpr|evtnm|formid).java.util.Set<java.lang.String>removeSaveFormFieldNames(Form self)Remove all field names for saving with the given Form.intsendCommand(java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> args)send command fired to this binder and process the command immediatelyvoidsetDynamicAttrs(java.lang.String command, java.lang.Object value)Internal use only.voidsetPhaseListener(PhaseListener listener)Sets the associated phase listener to intervene the binding life cycle.voidsetTemplate(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String templateExpr, java.util.Map<java.lang.String,java.lang.Object> templateArgs)set template to a component property by an expressionvoidsetValidationMessages(ValidationMessages messages)Set theValidationMessagesvoidsetViewModel(java.lang.Object vm)Sets associated ViewModel of this binder.voidstoreForm(org.zkoss.zk.ui.Component comp, java.lang.String id, Form form)Store the form in the component with id
-
-
-
Field Detail
-
DISABLE_METHOD_CACHE
public static final boolean DISABLE_METHOD_CACHE
-
ZKFORMPROXYNOTIFIEDKEY
public static final java.lang.String ZKFORMPROXYNOTIFIEDKEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(org.zkoss.zk.ui.Component comp, java.lang.Object viewModel, java.util.Map<java.lang.String,java.lang.Object> initArgs)Description copied from interface:BinderInitializes the binder with a root component and viewModel object. You should never call this if you useAnnotateBinderand zk annotation
-
destroy
public void destroy(org.zkoss.zk.ui.Component comp, java.lang.Object viewModel)Description copied from interface:BinderDestroys the binder with a root component and viewModel object. You should never call this if you useAnnotateBinderand zk annotation
-
checkInit
protected void checkInit()
-
getBindings
public java.util.Map<java.lang.String,java.util.List<Binding>> getBindings(org.zkoss.zk.ui.Component comp)
-
setViewModel
public void setViewModel(java.lang.Object vm)
Description copied from interface:BinderSets associated ViewModel of this binder.- Specified by:
setViewModelin interfaceBinder- Parameters:
vm- the associated view model of this binder.
-
getViewModel
public java.lang.Object getViewModel()
Description copied from interface:BinderReturns associated ViewModel of this binder.- Specified by:
getViewModelin interfaceBinder- Returns:
- associated ViewModel of this binder.
-
getConverter
public Converter getConverter(java.lang.String name)
Description copied from interface:BinderReturns the _converter of the given _converter name.- Specified by:
getConverterin interfaceBinder- Parameters:
name- _converter name- Returns:
- the _converter of the given _converter name.
-
getValidator
public Validator getValidator(java.lang.String name)
Description copied from interface:BinderReturns the _validator of the given _validator name.- Specified by:
getValidatorin interfaceBinder- Parameters:
name- _validator name- Returns:
- the _validator of the given _validator name.
-
getRenderer
protected java.lang.Object getRenderer(java.lang.String name)
-
getEvaluatorX
public BindEvaluatorX getEvaluatorX()
Description copied from interface:BinderReturns theBindEvaluatorXused by this Binder.- Specified by:
getEvaluatorXin interfaceBinder- Returns:
- the EvaluatorX.
-
storeForm
public void storeForm(org.zkoss.zk.ui.Component comp, java.lang.String id, Form form)Description copied from interface:BinderCtrlStore the form in the component with id- Specified by:
storeFormin interfaceBinderCtrl- Parameters:
comp- the component to store the formid- the form idform- the form instance
-
getForm
public Form getForm(org.zkoss.zk.ui.Component comp, java.lang.String id)
Description copied from interface:BinderCtrlGet the form of the component- Specified by:
getFormin interfaceBinderCtrl- Parameters:
comp- the component has the formid- the form id- Returns:
- the form if there is a form inside the component with the id
-
addFormInitBinding
public void addFormInitBinding(org.zkoss.zk.ui.Component comp, java.lang.String id, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> initArgs)Description copied from interface:Binderinit a component form by expression, it only execute once- Specified by:
addFormInitBindingin interfaceBinder- Parameters:
comp- the associated component, must not nullid- the form id, must not nullinitExpr- init expression, nullableinitArgs- args key-value pairs for this init, nullable
-
addFormLoadBindings
public void addFormLoadBindings(org.zkoss.zk.ui.Component comp, java.lang.String id, java.lang.String loadExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)Description copied from interface:BinderAdd new form-load-bindings. It create a prompt|conditional form-load-binding depends on beforeCmds and afterCmds. If both beforeCmds and afterCmds are null or empty, it create a prompt binding.- Specified by:
addFormLoadBindingsin interfaceBinder- Parameters:
comp- the associated component, must not nullid- the form id, must not nullloadExpr- load expression, nullablebeforeCmds- load before these commands, the command here is not a EL expression. nullableafterCmds- load after these commands, the command here is not a EL expression. nullablebindingArgs- args key-value pairs for this binding, nullable
-
addFormSaveBindings
public void addFormSaveBindings(org.zkoss.zk.ui.Component comp, java.lang.String id, java.lang.String saveExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String validatorExpr, java.util.Map<java.lang.String,java.lang.Object> validatorArgs)Description copied from interface:BinderAdd new form-save-bindings. It create a conditional form-save-binding depends on beforeCmds and afterCmds. Since form-save-binding is always triggered by command, if both beforeCmds and afterCmds are null or empty, it throws an exception.- Specified by:
addFormSaveBindingsin interfaceBinder- Parameters:
comp- the associated component, must not nullid- the form id, must not nullsaveExpr- save expression, nullablebeforeCmds- save before these commands, the command here is not a EL expression. nullableafterCmds- save after these commands, the command here is not a EL expression. nullablebindingArgs- args key-value pairs for this binding, nullablevalidatorExpr- the converter expression, nullablevalidatorArgs- args key-value pairs for validator, nullable
-
addPropertyInitBinding
public void addPropertyInitBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> initArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Description copied from interface:Binderinit a component property by a expression, it only execute once- Specified by:
addPropertyInitBindingin interfaceBinder- Parameters:
comp- the associated component, must not nullattr- the associated attribute of the component; ex label, style, must not nullinitExpr- init expression, must not nullinitArgs- args key-value pairs for initial, nullableconverterExpr- the converter expression, nullableconverterArgs- args key-value pairs for converter, nullable
-
addPropertyLoadBindings
public void addPropertyLoadBindings(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String loadExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Description copied from interface:BinderAdd new property-load-bindings. It creates a prompt|conditional property-load-binding depends on beforeCmds and afterCmds. If both beforeCmds and afterCmds are null or empty, it create a prompt binding.- Specified by:
addPropertyLoadBindingsin interfaceBinder- Parameters:
comp- the associated component, must not nullattr- the associated attribute of the component; ex label, style, must not nullloadExpr- load expression, must not nullbeforeCmds- load before these commands, the command here is not a EL expression. nullableafterCmds- load after these commands, the command here is not a EL expression. nullablebindingArgs- args key-value pairs for this binding, nullableconverterExpr- the converter expression, nullableconverterArgs- args key-value pairs for converter, nullable
-
addPropertySaveBindings
public void addPropertySaveBindings(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String saveExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs, java.lang.String validatorExpr, java.util.Map<java.lang.String,java.lang.Object> validatorArgs)Description copied from interface:BinderAdd new property-save-bindings. It creates a prompt|conditional property-save-binding depends on beforeCmds and afterCmds. If both beforeCmds and afterCmds are null or empty, it create a prompt binding.- Specified by:
addPropertySaveBindingsin interfaceBinder- Parameters:
comp- the associated component, must not nullattr- the associated attribute of the component; ex value, check, must not nullsaveExpr- save expression, nullablebeforeCmds- save before these commands, the command here is not a EL expression. nullableafterCmds- save after these commands, the command here is not a EL expression. nullablebindingArgs- args key-value pairs for this binding, nullableconverterExpr- the converter expression, nullableconverterArgs- args key-value pairs for converter, nullablevalidatorExpr- the converter expression, nullablevalidatorArgs- args key-value pairs for validator, nullable
-
newLoadPropertyBinding
protected LoadPropertyBinding newLoadPropertyBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String loadAttr, java.lang.Class<?> attrType, java.lang.String loadExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)
Make this extenable.- Since:
- 7.0.3
-
newSavePropertyBinding
protected SavePropertyBinding newSavePropertyBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String saveAttr, java.lang.String saveExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs, java.lang.String validatorExpr, java.util.Map<java.lang.String,java.lang.Object> validatorArgs)
Make this extenable.- Since:
- 7.0.3
-
newInitPropertyBinding
protected InitPropertyBinding newInitPropertyBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String loadAttr, java.lang.Class<?> attrType, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)
Make this extenable.- Since:
- 7.0.3
-
newInitChildrenBinding
protected InitChildrenBinding newInitChildrenBinding(org.zkoss.zk.ui.Component comp, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)
Make this extenable.- Since:
- 7.0.3
-
newLoadChildrenBinding
protected LoadChildrenBinding newLoadChildrenBinding(org.zkoss.zk.ui.Component comp, java.lang.String loadExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)
Make this extenable.- Since:
- 7.0.3
-
newCommandBinding
protected CommandBinding newCommandBinding(org.zkoss.zk.ui.Component comp, java.lang.String evtnm, java.lang.String cmdScript, java.util.Map<java.lang.String,java.lang.Object> args)
Make this extenable.- Since:
- 7.0.3
-
newInitFormBinding
protected InitFormBinding newInitFormBinding(org.zkoss.zk.ui.Component comp, java.lang.String formId, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)
Make this extenable.- Since:
- 7.0.3
-
newLoadFormBinding
protected LoadFormBinding newLoadFormBinding(org.zkoss.zk.ui.Component comp, java.lang.String formId, java.lang.String loadExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)
Make this extenable.- Since:
- 7.0.3
-
newSaveFormBinding
protected SaveFormBinding newSaveFormBinding(org.zkoss.zk.ui.Component comp, java.lang.String formId, java.lang.String saveExpr, ConditionType conditionType, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String validatorExpr, java.util.Map<java.lang.String,java.lang.Object> validatorArgs)
Make this extenable.- Since:
- 7.0.3
-
addChildrenInitBinding
public void addChildrenInitBinding(org.zkoss.zk.ui.Component comp, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> initArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Description copied from interface:Binderinit children of a component by an expression, it only execute once- Specified by:
addChildrenInitBindingin interfaceBinder- Parameters:
comp- the associated component, must not nullinitExpr- init expression, must not nullinitArgs- args key-value pairs for initial, nullableconverterExpr- the converter expression, nullableconverterArgs- args key-value pairs for converter, nullable
-
addChildrenLoadBindings
public void addChildrenLoadBindings(org.zkoss.zk.ui.Component comp, java.lang.String loadExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs, java.lang.String converterExpr, java.util.Map<java.lang.String,java.lang.Object> converterArgs)Description copied from interface:BinderAdd new children-load-bindings. It creates a prompt|conditional children-load-binding depends on beforeCmds and afterCmds. If both beforeCmds and afterCmds are null or empty, it create a prompt binding.- Specified by:
addChildrenLoadBindingsin interfaceBinder- Parameters:
comp- the associated component, must not nullloadExpr- load expression, must not nullbeforeCmds- load before these commands, the command here is not a EL expression. nullableafterCmds- load after these commands, the command here is not a EL expression. nullablebindingArgs- args key-value pairs for this binding, nullableconverterExpr- the converter expression, nullableconverterArgs- args key-value pairs for converter, nullable
-
addReferenceBinding
public void addReferenceBinding(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String loadExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)Description copied from interface:BinderAdd a new reference-binding. It creates an attribute as the reference of the expression in the component.- Specified by:
addReferenceBindingin interfaceBinder- Parameters:
comp- the associated component, must not nullattr- the name of reference that stored in the component; ex myval, must not nullloadExpr- load expression, must not nullbindingArgs- args key-value pairs for this binding, nullable
-
addCommandBinding
public void addCommandBinding(org.zkoss.zk.ui.Component comp, java.lang.String evtnm, java.lang.String commandExpr, java.util.Map<java.lang.String,java.lang.Object> args)Description copied from interface:BinderAdd a new command binding.- Specified by:
addCommandBindingin interfaceBinder- Parameters:
comp- the associated componentevtnm- the associated component event namecommandExpr- the command expressionargs- other key-value pairs pairs for command
-
addGlobalCommandBinding
public void addGlobalCommandBinding(org.zkoss.zk.ui.Component comp, java.lang.String evtnm, java.lang.String commandExpr, java.util.Map<java.lang.String,java.lang.Object> args)Description copied from interface:BinderAdd a new global-command binding.- Specified by:
addGlobalCommandBindingin interfaceBinder- Parameters:
comp- the associated componentevtnm- the associated component event namecommandExpr- the command expressionargs- other key-value pairs pairs for command
-
isActivating
public boolean isActivating()
Description copied from interface:BinderCtrlcheck if binder is in activating state- Specified by:
isActivatingin interfaceBinderCtrl- Returns:
- true if binder is currently in activating state
- Since:
- 6.0.1
-
sendCommand
public int sendCommand(java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> args)Description copied from interface:Bindersend command fired to this binder and process the command immediately- Specified by:
sendCommandin interfaceBinder- Parameters:
command- command nameargs- , arguments when notifying this command, it will be passed as a arguments of execution method of vm- Returns:
- the result of the doCommand, COMMAND_SUCCESS or COMMAND_FAIL_VALIDATE (since 8.0.1)
-
fireNotifyChanges
protected void fireNotifyChanges(java.util.Set<Property> notifys)
-
postCommand
public void postCommand(java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> args)Description copied from interface:Binderpost command this binder, binder will queue the command, and fired later.- Specified by:
postCommandin interfaceBinder- Parameters:
command- command nameargs- , arguments when notifying this command, it will be passed as a arguments of execution method of vm
-
doValidate
protected boolean doValidate(org.zkoss.zk.ui.Component comp, java.lang.String command, org.zkoss.zk.ui.event.Event evt, BindContext ctx, java.util.Set<Property> notifys)
-
createParamCall
protected ParamCall createParamCall(BindContext ctx)
-
doExecute
protected void doExecute(org.zkoss.zk.ui.Component comp, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> commandArgs, BindContext ctx, java.util.Set<Property> notifys)
-
doSaveBefore
protected void doSaveBefore(org.zkoss.zk.ui.Component comp, java.lang.String command, org.zkoss.zk.ui.event.Event evt, BindContext ctx, java.util.Set<Property> notifys)
-
doSaveAfter
protected void doSaveAfter(org.zkoss.zk.ui.Component comp, java.lang.String command, org.zkoss.zk.ui.event.Event evt, BindContext ctx, java.util.Set<Property> notifys)
-
doLoadBefore
protected void doLoadBefore(org.zkoss.zk.ui.Component comp, java.lang.String command, BindContext ctx)
-
doLoadAfter
protected void doLoadAfter(org.zkoss.zk.ui.Component comp, java.lang.String command, BindContext ctx)
-
removeBindings
public void removeBindings(java.util.Set<org.zkoss.zk.ui.Component> comps)
Description copied from interface:BinderRemove all managed bindings that associated with the specified components.- Specified by:
removeBindingsin interfaceBinder
-
removeBindings
public void removeBindings(org.zkoss.zk.ui.Component comp)
Remove all bindings that associated with the specified component.- Specified by:
removeBindingsin interfaceBinder- Parameters:
comp- the component
-
removeBindings
public void removeBindings(org.zkoss.zk.ui.Component comp, java.lang.String key)Remove all bindings that associated with the specified component and key (_fieldExpr|evtnm|formid).- Specified by:
removeBindingsin interfaceBinder- Parameters:
comp- the componentkey- can be component attribute, event name, or form id
-
getLoadPromptBindings
public java.util.List<Binding> getLoadPromptBindings(org.zkoss.zk.ui.Component comp, java.lang.String attr)
Description copied from interface:BinderCtrlget all load prompt binding of the component and attribute- Specified by:
getLoadPromptBindingsin interfaceBinderCtrl- Parameters:
comp- the component is relative to the bindingsattr- the attribute is relative to the bindings- Returns:
- the prompt-load-bindings
-
setTemplate
public void setTemplate(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String templateExpr, java.util.Map<java.lang.String,java.lang.Object> templateArgs)Description copied from interface:Binderset template to a component property by an expression- Specified by:
setTemplatein interfaceBinder- Parameters:
comp- the associated component, must not nullattr- the associated attribute of the component; ex label, style, must not nulltemplateExpr- template expression, must not nulltemplateArgs- args key-value pairs for template, nullable
-
getTemplateResolver
public TemplateResolver getTemplateResolver(org.zkoss.zk.ui.Component comp, java.lang.String attr)
Description copied from interface:BinderCtrlget the template resolver that sets byBinder.setTemplate(Component, String, String, java.util.Map)- Specified by:
getTemplateResolverin interfaceBinderCtrl- Parameters:
comp- the component has resolversattr- the attribute to get the resolver- Returns:
- the resolver, null if not existed.
-
getTracker
public Tracker getTracker()
Description copied from interface:BinderCtrlReturns associated dependency tracker of this binder.- Specified by:
getTrackerin interfaceBinderCtrl- Returns:
- associated dependency tracker of this binder.
-
loadComponent
public void loadComponent(org.zkoss.zk.ui.Component comp, boolean loadinit)Internal Use only. init and load the component- Specified by:
loadComponentin interfaceBinder- Parameters:
comp- the component to reloadloadinit- true if should also load the init-binding
-
getDynamicAttrs
public java.util.Map<java.lang.String,java.lang.Object> getDynamicAttrs()
Internal use only.- Since:
- 8.0.0
-
setDynamicAttrs
public void setDynamicAttrs(java.lang.String command, java.lang.Object value)Internal use only.- Since:
- 8.0.0
-
loadComponent0
protected void loadComponent0(org.zkoss.zk.ui.Component comp, boolean loadinit)
-
notifyChange
public void notifyChange(java.lang.Object base, java.lang.String attr)Description copied from interface:BinderNotify change of the property.- Specified by:
notifyChangein interfaceBinder- Parameters:
base- the backing bean object.attr- the property of the bean that change the value
-
setPhaseListener
public void setPhaseListener(PhaseListener listener)
Description copied from interface:BinderSets the associated phase listener to intervene the binding life cycle.- Specified by:
setPhaseListenerin interfaceBinder- Parameters:
listener- the associated phase listener.
-
addPhaseListener
public void addPhaseListener(PhaseListener listener)
Description copied from interface:BinderCtrlAdd thePhaseListener- Specified by:
addPhaseListenerin interfaceBinderCtrl
-
getPhaseListener
public PhaseListener getPhaseListener()
-
getPhaseListeners
public java.util.List<PhaseListener> getPhaseListeners()
Description copied from interface:BinderCtrlget the firstPhaseListener- Specified by:
getPhaseListenersin interfaceBinderCtrl- Returns:
- the
PhaseListener
-
getEventQueue
protected org.zkoss.zk.ui.event.EventQueue<org.zkoss.zk.ui.event.Event> getEventQueue()
-
addFormAssociatedSaveBinding
public void addFormAssociatedSaveBinding(org.zkoss.zk.ui.Component associatedComp, java.lang.String formId, SaveBinding saveBinding, java.lang.String fieldName)Description copied from interface:BinderCtrlAdd a association between formId and a associated save binding(save binding inside a form), the form has to exist in the parent components- Specified by:
addFormAssociatedSaveBindingin interfaceBinderCtrl- Parameters:
associatedComp- associated component inside a form bindingformId- the form idsaveBinding- the nested save binding in side a form bindingfieldName- the associated form fieldName for the associated save binding
-
getFormAssociatedSaveBindings
public java.util.Set<SaveBinding> getFormAssociatedSaveBindings(org.zkoss.zk.ui.Component comp)
Description copied from interface:BinderCtrlGet associated save bindings of a form in a component- Specified by:
getFormAssociatedSaveBindingsin interfaceBinderCtrl- Parameters:
comp- the component that contains the form- Returns:
- all associated save binding in the form
-
hasValidator
public boolean hasValidator(org.zkoss.zk.ui.Component comp, java.lang.String attr)Description copied from interface:BinderCtrlis there a validator on the attribute of component- Specified by:
hasValidatorin interfaceBinderCtrl- Parameters:
comp- the component to checkattr- the attribute to check- Returns:
- true if there is a validator
-
getView
public org.zkoss.zk.ui.Component getView()
Description copied from interface:BinderReturns associated root component of this binder.
-
getValidationMessages
public ValidationMessages getValidationMessages()
Description copied from interface:BinderCtrlGet theValidationMessages- Specified by:
getValidationMessagesin interfaceBinderCtrl- Returns:
- null if no one set the instance by
BinderCtrl.setValidationMessages(ValidationMessages)
-
setValidationMessages
public void setValidationMessages(ValidationMessages messages)
Description copied from interface:BinderCtrlSet theValidationMessages- Specified by:
setValidationMessagesin interfaceBinderCtrl- Parameters:
messages- theValidationMessages
-
getBindingExecutionInfoCollector
public BindingExecutionInfoCollector getBindingExecutionInfoCollector()
Description copied from interface:BinderCtrlget binding execution info collector- Specified by:
getBindingExecutionInfoCollectorin interfaceBinderCtrl- Returns:
- the collector instance or null if no collector is existed
-
getBindingAnnotationInfoChecker
public BindingAnnotationInfoChecker getBindingAnnotationInfoChecker()
Description copied from interface:BinderCtrlget binding annotation info checker- Specified by:
getBindingAnnotationInfoCheckerin interfaceBinderCtrl- Returns:
- the collector instance or null if no collector is existed
-
getQueueName
public java.lang.String getQueueName()
Description copied from interface:BinderCtrlReturns the queue name of this binder- Specified by:
getQueueNamein interfaceBinderCtrl
-
getQueueScope
public java.lang.String getQueueScope()
Description copied from interface:BinderCtrlReturns the queue scope of this binder- Specified by:
getQueueScopein interfaceBinderCtrl
-
getMatchMediaValue
public java.util.Map<java.lang.String,java.lang.reflect.Method> getMatchMediaValue()
Description copied from interface:BinderCtrlReturns an unmodifiable Map containing all the MatchMedia annotation values of this binder. If there's no MatchMedia annotation, it returns an empty Map.- Specified by:
getMatchMediaValuein interfaceBinderCtrl
-
addSaveFormFieldName
public void addSaveFormFieldName(Form form, java.lang.String fieldName)
Description copied from interface:BinderCtrlAdds a field name for saving with the given Form.- Specified by:
addSaveFormFieldNamein interfaceBinderCtrlfieldName- field name to be saved into.
-
addSaveFormFieldName
public void addSaveFormFieldName(Form form, java.util.Set<java.lang.String> fieldNames)
Description copied from interface:BinderCtrlAdds all field names for saving with the given Form.- Specified by:
addSaveFormFieldNamein interfaceBinderCtrlfieldNames- field name to be saved into.
-
removeSaveFormFieldNames
public java.util.Set<java.lang.String> removeSaveFormFieldNames(Form self)
Description copied from interface:BinderCtrlRemove all field names for saving with the given Form.- Specified by:
removeSaveFormFieldNamesin interfaceBinderCtrl
-
getSaveFormFieldNames
public java.util.Set<java.lang.String> getSaveFormFieldNames(Form form)
Description copied from interface:BinderCtrlReturns all field names for saving with the given Form.- Specified by:
getSaveFormFieldNamesin interfaceBinderCtrl
-
initQueue
public void initQueue()
Internal use only. Check and init queue- Specified by:
initQueuein interfaceBinderCtrl
-
initActivator
public void initActivator()
Internal use only. Check and init Activator- Specified by:
initActivatorin interfaceBinderCtrl
-
-