Errai 3.0.1-SNAPSHOT

org.jboss.errai.ui.shared.api.annotations
Annotation Type Model


@Documented
@Target(value={FIELD,PARAMETER})
@Retention(value=RUNTIME)
public @interface Model

Indicates that the annotated model should be managed by a DataBinder and therefore automatically bound to all enclosing widgets.

The widgets are inferred from all enclosing fields and methods annotated with Bound of the class that defines the Model and all its super classes.

The annotated model can be a field and a method or constructor parameter. The following example shows all use cases for the Model annotation.

      public class MyBean {
        @Inject @Model 
        private MyModel model;
      
        @Inject
        public MyBean(@Model MyModel model) {
          this.model = model;
        }
        
        @Inject
        public void setModel(@Model MyModel model) {
          this.model = model;
        }
      }
 
There can only be one Model per class.

Author:
Christian Sadilek , Mike Brock


Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.