KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > kilim > description > ClassSource


1 package org.objectweb.kilim.description;
2
3 import org.objectweb.kilim.KilimException;
4
5 /**
6  * @author horn
7  */

8 public class ClassSource extends InlinedElement {
9     private String JavaDoc className;
10     
11     /**
12      * The public constructor for a class source.
13      * @param aClassName : the name of the class.
14      * @param aTemplate : the template in which the class source is defined.
15      * @throws KilimException : generated when the className reference is null.
16      */

17     public ClassSource(String JavaDoc aClassName, TemplateDescription aTemplate) throws KilimException {
18         super(true, false, aTemplate);
19         if (aClassName == null) {
20             throw new KilimException("illegal null class name in template " + aTemplate.getName());
21         }
22         className = aClassName;
23     }
24     
25     /**
26      * returns the name of the class source.
27      * @return String
28      */

29     public String JavaDoc getClassName() {
30         return className;
31     }
32
33     /**
34      * sets the name of the class source.
35      * @param aClassName : sets the class name.
36      * @throws KilimException : generated when the class name is null.
37      */

38     public void setClassName(String JavaDoc aClassName) throws KilimException {
39         if (aClassName == null) {
40             throw new KilimException("attempt to set a null class name to a class source " + className + " in template " + getContainingTemplate().getName());
41         }
42         className = aClassName;
43     }
44     
45     /**
46      * @see org.objectweb.kilim.description.BasicElement#getKind()
47      */

48     public int getKind() {
49         return KILIM.CLASS;
50     }
51 }
52     
53     /**
54      * Method setSupport has been defined as a rather high levelThis method should not be used. It always generates a KilimException.
55      * @param aElement : the element to be used as support (i.e. the object on which the method, constructor or .... will be invoked).
56      * @throws KilimException :
57      *
58     public void setSupport(BasicElement aElement) throws KilimException {
59         throw new KilimException("attempt to set a support for ClassSource " + className + " in template " + getContainingTemplate().getName());
60     }
61     
62     /**
63      * Method getSupport.
64      * @return BasicElement
65      *
66     public BasicElement getSupport() {
67         return null;
68     }
69     
70     /**
71      *
72      * @return boolean
73      *
74     public boolean isStatic() {
75         return true;
76     }
77
78     */
Popular Tags