KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > util > Namespace


1 package org.sapia.soto.util;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.List JavaDoc;
5
6
7 /**
8  * Models a namespaces - that encapsulates definitions.
9  *
10  * @see org.sapia.soto.util.Def
11  *
12  * @author Yanick Duchesne
13  * <dl>
14  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
15  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
16  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
17  * </dl>
18  */

19 public class Namespace {
20   private String JavaDoc _prefix;
21   private CompositeObjectFactoryEx _fac;
22   private List JavaDoc _defs = new ArrayList JavaDoc(10);
23
24   /**
25    * Constructor for Defs.
26    */

27   public Namespace(CompositeObjectFactoryEx fac) {
28     _fac = fac;
29   }
30
31   /**
32    * Sets the XML namespace prefix to which this instance corresponds.
33    *
34    * @param prefix a namespace prefix.
35    */

36   public void setPrefix(String JavaDoc prefix) {
37     _prefix = prefix;
38   }
39
40   public String JavaDoc getPrefix() {
41     return _prefix;
42   }
43
44   public Def addDef() {
45     Def def = new Def();
46
47     _defs.add(def);
48
49     return def;
50   }
51
52   public List JavaDoc getDefs() {
53     return _defs;
54   }
55 }
56
Popular Tags