KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > xml > nuts > DelegatingBinderNut


1 package jfun.yan.xml.nuts;
2
3 import jfun.yan.Binder;
4 import jfun.yan.xml.nut.BinderNut;
5
6 /**
7  * The super class for any Nut that evaluates to Binder
8  * and has a "binder" attribute or a sub-element that accepts a Binder.
9  * <p>
10  * @author Ben Yu
11  * Nov 12, 2005 11:13:59 PM
12  */

13 public abstract class DelegatingBinderNut extends BinderNut {
14   private Binder binder;
15   /*
16   public void set(Binder[] binders){
17     checkSingleChild(binders);
18     checkDuplicate("binder", binder);
19     binder = binders[0];
20   }*/

21   public void add(Binder binder){
22     checkDuplicate("binder", this.binder);
23     this.binder = binder;
24   }
25   public Binder getBinder() {
26     return binder;
27   }
28
29   public void setBinder(Binder binder) {
30     this.binder = binder;
31   }
32   /**
33    * Get the binder object.
34    * Exception is thrown if the binder is not set yet.
35    */

36   protected Binder getMandatory(){
37     checkMandatory("binder", binder);
38     return binder;
39   }
40 }
41
Popular Tags