KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > gumby > factory > Namespace


1 package org.sapia.gumby.factory;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.List JavaDoc;
5
6 import org.sapia.util.xml.confix.ConfigurationException;
7 import org.sapia.util.xml.confix.ObjectCreationCallback;
8
9 /**
10  * @author Yanick Duchesne
11  *
12  * <dl>
13  * <dt><b>Copyright: </b>
14  * <dd>Copyright &#169; 2002-2005 <a HREF="http://www.sapia-oss.org">Sapia Open
15  * Source Software </a>. All Rights Reserved.</dd>
16  * </dt>
17  * <dt><b>License: </b>
18  * <dd>Read the license.txt file of the jar or visit the <a
19  * HREF="http://www.sapia-oss.org/license.html">license page </a> at the Sapia
20  * OSS web site</dd>
21  * </dt>
22  * </dl>
23  */

24 public class Namespace implements ObjectCreationCallback {
25
26   private GumbyObjectFactory _fac;
27
28   private String JavaDoc _prefix;
29   private List JavaDoc _defs = new ArrayList JavaDoc();
30
31   Namespace(GumbyObjectFactory fac) {
32     _fac = fac;
33   }
34
35   public void setPrefix(String JavaDoc prefix) {
36     _prefix = prefix;
37   }
38
39   public String JavaDoc getPrefix() {
40     return _prefix;
41   }
42
43   public Def createDef() {
44     Def def = new Def();
45     _defs.add(def);
46     return def;
47   }
48
49   public List JavaDoc getDefs() {
50     return _defs;
51   }
52
53   /**
54    * @see org.sapia.util.xml.confix.ObjectCreationCallback#onCreate()
55    */

56   public Object JavaDoc onCreate() throws ConfigurationException {
57     _fac.registerDefs(this);
58     return this;
59   }
60
61 }
62
Popular Tags