|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.bind.impl.BinderImpl
public class BinderImpl
Implementation of Binder.
Field Summary | |
---|---|
static java.lang.String |
BINDCTX
|
static java.lang.String |
BINDER
|
static java.lang.String |
BINDING
|
static java.lang.String |
DEPENDS_ON_COMP
|
static java.lang.String |
IGNORE_REF_VALUE
|
static java.lang.String |
IGNORE_TRACKER
|
static java.lang.String |
LOAD_FORM_COMPONENT
|
static java.lang.String |
LOAD_FORM_EXPRESSION
|
static java.lang.String |
MODEL
|
static java.lang.String |
NOTIFYS
|
static java.lang.String |
ON_BIND_CLEAN
|
static java.lang.String |
ON_BIND_INIT
|
static java.lang.String |
RENDERER_INSTALLED
|
static java.lang.String |
SAVE_BASE
|
static java.lang.String |
SRCPATH
|
static java.lang.String |
VALIDATES
|
static java.lang.String |
VAR
|
static java.lang.String |
VM
|
Fields inherited from interface org.zkoss.bind.Binder |
---|
ACCESS, CONVERTER, LOAD_EVENT, LOAD_REPLACEMENT, LOAD_TYPE, RENDERER, SAVE_EVENT, SAVE_REPLACEMENT, VALIDATOR, ZKBIND |
Fields inherited from interface org.zkoss.bind.sys.BinderCtrl |
---|
DEFAULT_QUEUE_NAME, DEFAULT_QUEUE_SCOPE, PHASE_LISTENER_CLASS_KEY |
Constructor Summary | |
---|---|
BinderImpl()
|
|
BinderImpl(java.lang.String qname,
java.lang.String qscope)
|
Method Summary | |
---|---|
void |
addChildrenInitBinding(Component comp,
java.lang.String initExpr,
java.util.Map<java.lang.String,java.lang.Object> initArgs)
Deprecated. |
void |
addChildrenInitBinding(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 once |
void |
addChildrenLoadBindings(Component comp,
java.lang.String loadExpr,
java.lang.String[] beforeCmds,
java.lang.String[] afterCmds,
java.util.Map<java.lang.String,java.lang.Object> bindingArgs)
Deprecated. |
void |
addChildrenLoadBindings(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. |
void |
addCommandBinding(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. |
void |
addFormAssociatedSaveBinding(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 components |
void |
addFormInitBinding(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 once |
void |
addFormLoadBindings(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. |
void |
addFormSaveBindings(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. |
void |
addGlobalCommandBinding(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. |
void |
addPropertyInitBinding(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 once |
void |
addPropertyLoadBindings(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. |
void |
addPropertySaveBindings(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. |
void |
addReferenceBinding(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. |
protected void |
checkInit()
|
BindingAnnotationInfoChecker |
getBindingAnnotationInfoChecker()
get binding annotation info checker |
BindingExecutionInfoCollector |
getBindingExecutionInfoCollector()
get binding execution info collector |
Converter |
getConverter(java.lang.String name)
Returns the _converter of the given _converter name. |
BindEvaluatorX |
getEvaluatorX()
Returns the BindEvaluatorX used by this Binder. |
protected EventQueue<Event> |
getEventQueue()
|
Form |
getForm(Component comp,
java.lang.String id)
Get the form of the component |
java.util.Set<SaveBinding> |
getFormAssociatedSaveBindings(Component comp)
Get associated save bindings of a form in a component |
java.util.List<Binding> |
getLoadPromptBindings(Component comp,
java.lang.String attr)
get all load prompt binding of the component and attribute |
PhaseListener |
getPhaseListener()
get the PhaseListener |
protected java.lang.Object |
getRenderer(java.lang.String name)
|
TemplateResolver |
getTemplateResolver(Component comp,
java.lang.String attr)
get the template resolver that sets by Binder.setTemplate(Component, String, String, java.util.Map) |
Tracker |
getTracker()
Returns associated dependency tracker of this binder. |
ValidationMessages |
getValidationMessages()
Get the ValidationMessages |
Validator |
getValidator(java.lang.String name)
Returns the _validator of the given _validator name. |
Component |
getView()
Returns associated root component of this binder. |
java.lang.Object |
getViewModel()
Returns associated ViewModel of this binder. |
boolean |
hasValidator(Component comp,
java.lang.String attr)
is there a validator on the attribute of component |
void |
init(Component comp,
java.lang.Object viewModel)
Deprecated. use init(Component, Object, Map) instead |
void |
init(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. |
boolean |
isActivating()
check if binder is in activating state |
void |
loadComponent(Component comp,
boolean loadinit)
Internal Use only. init and load the component |
void |
notifyChange(java.lang.Object base,
java.lang.String attr)
Notify change of the property. |
void |
postCommand(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. |
void |
removeBindings(Component comp)
Remove all bindings that associated with the specified component. |
void |
removeBindings(Component comp,
java.lang.String key)
Remove all bindings that associated with the specified component and key (_fieldExpr|evtnm|formid). |
void |
sendCommand(java.lang.String command,
java.util.Map<java.lang.String,java.lang.Object> args)
send command fired to this binder and process the command immediately |
void |
setPhaseListener(PhaseListener listener)
Sets the associated phase listener to intervene the binding life cycle. |
void |
setTemplate(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 expression |
void |
setValidationMessages(ValidationMessages messages)
Set the ValidationMessages |
void |
setViewModel(java.lang.Object vm)
Sets associated ViewModel of this binder. |
void |
storeForm(Component comp,
java.lang.String id,
Form form)
Store the form in the component with id |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BINDING
public static final java.lang.String BINDER
public static final java.lang.String BINDCTX
public static final java.lang.String VAR
public static final java.lang.String VM
public static final java.lang.String NOTIFYS
public static final java.lang.String VALIDATES
public static final java.lang.String SRCPATH
public static final java.lang.String DEPENDS_ON_COMP
public static final java.lang.String RENDERER_INSTALLED
public static final java.lang.String LOAD_FORM_EXPRESSION
public static final java.lang.String LOAD_FORM_COMPONENT
public static final java.lang.String IGNORE_TRACKER
public static final java.lang.String IGNORE_REF_VALUE
public static final java.lang.String SAVE_BASE
public static final java.lang.String ON_BIND_INIT
public static final java.lang.String ON_BIND_CLEAN
public static final java.lang.String MODEL
Constructor Detail |
---|
public BinderImpl()
public BinderImpl(java.lang.String qname, java.lang.String qscope)
Method Detail |
---|
protected void checkInit()
public void init(Component comp, java.lang.Object viewModel)
init(Component, Object, Map)
instead
Binder
AnnotateBinder
and zk annotation
init
in interface Binder
comp
- root component of binderviewModel
- viewModel objectpublic void init(Component comp, java.lang.Object viewModel, java.util.Map<java.lang.String,java.lang.Object> initArgs)
Binder
AnnotateBinder
and zk annotation
init
in interface Binder
comp
- root component of binderviewModel
- viewModel objectinitArgs
- args key-value pairs for initial, nullablepublic void setViewModel(java.lang.Object vm)
Binder
setViewModel
in interface Binder
vm
- the associated view model of this binder.public java.lang.Object getViewModel()
Binder
getViewModel
in interface Binder
public Converter getConverter(java.lang.String name)
Binder
getConverter
in interface Binder
name
- _converter name
public Validator getValidator(java.lang.String name)
Binder
getValidator
in interface Binder
name
- _validator name
protected java.lang.Object getRenderer(java.lang.String name)
public BindEvaluatorX getEvaluatorX()
Binder
BindEvaluatorX
used by this Binder.
getEvaluatorX
in interface Binder
public void storeForm(Component comp, java.lang.String id, Form form)
BinderCtrl
storeForm
in interface BinderCtrl
comp
- the component to store the formid
- the form idform
- the form instancepublic Form getForm(Component comp, java.lang.String id)
BinderCtrl
getForm
in interface BinderCtrl
comp
- the component has the formid
- the form id
public void addFormInitBinding(Component comp, java.lang.String id, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> initArgs)
Binder
addFormInitBinding
in interface Binder
comp
- the associated component, must not nullid
- the form id, must not nullinitExpr
- init expression, nullableinitArgs
- args key-value pairs for this init, nullablepublic void addFormLoadBindings(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)
Binder
addFormLoadBindings
in interface Binder
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, nullablepublic void addFormSaveBindings(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)
Binder
addFormSaveBindings
in interface Binder
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, nullablepublic void addPropertyInitBinding(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)
Binder
addPropertyInitBinding
in interface Binder
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, nullablepublic void addPropertyLoadBindings(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)
Binder
addPropertyLoadBindings
in interface Binder
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, nullablepublic void addPropertySaveBindings(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)
Binder
addPropertySaveBindings
in interface Binder
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@Deprecated public void addChildrenInitBinding(Component comp, java.lang.String initExpr, java.util.Map<java.lang.String,java.lang.Object> initArgs)
Binder
addChildrenInitBinding
in interface Binder
comp
- the associated component, must not nullinitExpr
- init expression, must not nullinitArgs
- args key-value pairs for initial, nullablepublic void addChildrenInitBinding(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)
Binder
addChildrenInitBinding
in interface Binder
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@Deprecated public void addChildrenLoadBindings(Component comp, java.lang.String loadExpr, java.lang.String[] beforeCmds, java.lang.String[] afterCmds, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)
Binder
addChildrenLoadBindings
in interface Binder
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, nullablepublic void addChildrenLoadBindings(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)
Binder
addChildrenLoadBindings
in interface Binder
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, nullablepublic void addReferenceBinding(Component comp, java.lang.String attr, java.lang.String loadExpr, java.util.Map<java.lang.String,java.lang.Object> bindingArgs)
Binder
addReferenceBinding
in interface Binder
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, nullablepublic void addCommandBinding(Component comp, java.lang.String evtnm, java.lang.String commandExpr, java.util.Map<java.lang.String,java.lang.Object> args)
Binder
addCommandBinding
in interface Binder
comp
- the associated componentevtnm
- the associated component event namecommandExpr
- the command expressionargs
- other key-value pairs pairs for commandpublic void addGlobalCommandBinding(Component comp, java.lang.String evtnm, java.lang.String commandExpr, java.util.Map<java.lang.String,java.lang.Object> args)
Binder
addGlobalCommandBinding
in interface Binder
comp
- the associated componentevtnm
- the associated component event namecommandExpr
- the command expressionargs
- other key-value pairs pairs for commandpublic boolean isActivating()
BinderCtrl
isActivating
in interface BinderCtrl
public void sendCommand(java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> args)
Binder
sendCommand
in interface Binder
command
- command nameargs
- , arguments when notifying this command, it will be passed as a arguments of execution method of vmpublic void postCommand(java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> args)
Binder
postCommand
in interface Binder
command
- command nameargs
- , arguments when notifying this command, it will be passed as a arguments of execution method of vmpublic void removeBindings(Component comp)
removeBindings
in interface Binder
comp
- the componentpublic void removeBindings(Component comp, java.lang.String key)
removeBindings
in interface Binder
comp
- the componentkey
- can be component attribute, event name, or form idpublic java.util.List<Binding> getLoadPromptBindings(Component comp, java.lang.String attr)
BinderCtrl
getLoadPromptBindings
in interface BinderCtrl
comp
- the component is relative to the bindingsattr
- the attribute is relative to the bindings
public void setTemplate(Component comp, java.lang.String attr, java.lang.String templateExpr, java.util.Map<java.lang.String,java.lang.Object> templateArgs)
Binder
setTemplate
in interface Binder
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, nullablepublic TemplateResolver getTemplateResolver(Component comp, java.lang.String attr)
BinderCtrl
Binder.setTemplate(Component, String, String, java.util.Map)
getTemplateResolver
in interface BinderCtrl
comp
- the component has resolversattr
- the attribute to get the resolver
public Tracker getTracker()
BinderCtrl
getTracker
in interface BinderCtrl
public void loadComponent(Component comp, boolean loadinit)
loadComponent
in interface Binder
comp
- the component to reloadloadinit
- true if should also load the init-bindingpublic void notifyChange(java.lang.Object base, java.lang.String attr)
Binder
notifyChange
in interface Binder
base
- the backing bean object.attr
- the property of the bean that change the valuepublic void setPhaseListener(PhaseListener listener)
Binder
setPhaseListener
in interface Binder
setPhaseListener
in interface BinderCtrl
listener
- the associated phase listener.public PhaseListener getPhaseListener()
BinderCtrl
PhaseListener
getPhaseListener
in interface BinderCtrl
PhaseListener
protected EventQueue<Event> getEventQueue()
public void addFormAssociatedSaveBinding(Component associatedComp, java.lang.String formId, SaveBinding saveBinding, java.lang.String fieldName)
BinderCtrl
addFormAssociatedSaveBinding
in interface BinderCtrl
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 bindingpublic java.util.Set<SaveBinding> getFormAssociatedSaveBindings(Component comp)
BinderCtrl
getFormAssociatedSaveBindings
in interface BinderCtrl
comp
- the component that contains the form
public boolean hasValidator(Component comp, java.lang.String attr)
BinderCtrl
hasValidator
in interface BinderCtrl
comp
- the component to checkattr
- the attribute to check
public Component getView()
Binder
getView
in interface Binder
public ValidationMessages getValidationMessages()
BinderCtrl
ValidationMessages
getValidationMessages
in interface BinderCtrl
BinderCtrl.setValidationMessages(ValidationMessages)
public void setValidationMessages(ValidationMessages messages)
BinderCtrl
ValidationMessages
setValidationMessages
in interface BinderCtrl
messages
- the ValidationMessages
public BindingExecutionInfoCollector getBindingExecutionInfoCollector()
BinderCtrl
getBindingExecutionInfoCollector
in interface BinderCtrl
public BindingAnnotationInfoChecker getBindingAnnotationInfoChecker()
BinderCtrl
getBindingAnnotationInfoChecker
in interface BinderCtrl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |