org.zkoss.bind.annotation
Annotation Type Init


@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Init

Marker annotation to identify a initial method.
Only one (could be zero) initial method is allowed in a particular class. if you want binder to call super calss's initial method also, you have to set superclass() to true, and super class's initial method will be called first. For example, in class hierarchy A(has init) <- B(has init) <- C(no init) <- D (has init, superclass true). D is the last one.
If D is the view model, will call D.init
If C is the view model, no method will be called br/> If B is the view model, will call A.init then B.init
If A is the view model, will call A.init
Note that, if you override a method, which is also the init method of the super class. ex, X.m1() <- Y.m1()
Because of the java limitation, you should set superclass to true in Y.m1() or Y.m1() will be called twice.
A initial method could also use with BindingParam and others to assign a argument as its parameter, and Default to assign a default value if the argument is null.

Since:
6.0.0
Author:
dennis
See Also:
BindingParam, ExecutionParam, ExecutionArgParam, HeaderParam, CookieParam, QueryParam, ScopeParam, ContextParam, Default

Optional Element Summary
 boolean superclass
           
 

superclass

public abstract boolean superclass
Default:
false


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo