KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.objectweb.kilim.description;
2
3 import java.util.Iterator JavaDoc;
4
5 import org.objectweb.kilim.InternalException;
6 import org.objectweb.kilim.KilimException;
7
8 /**
9  * @author horn
10  * This is the parent interface for all interfaces and classes corresponding to template entites
11  */

12 public abstract class TemplateElementImpl implements TemplateElement {
13     private TemplateDescription containingTemplate;
14
15     /**
16      * A public constructor for TemplateElementImpl.
17      * @param aTemplate : the template containing the element.
18      */

19     protected TemplateElementImpl(TemplateDescription aTemplate) {
20         containingTemplate = aTemplate;
21     }
22     
23     /**
24      * @see java.lang.Object#Object()
25      */

26     protected TemplateElementImpl() {
27         this(null);
28     }
29         
30     /**
31      * @see org.objectweb.kilim.description.TemplateElement#getTemplate()
32      */

33     public TemplateDescription getContainingTemplate() {
34         return containingTemplate;
35     }
36     
37     /**
38      * @see org.objectweb.kilim.description.TemplateElement#getTemplateDefHierarchy()
39      */

40     public Iterator JavaDoc getTemplateDefHierarchy() {
41         try {
42             return getContainingTemplate().getTemplateDefHierarchy(this);
43         } catch (KilimException ex) {
44             throw new InternalException(ex);
45         }
46     }
47     
48     /**
49      * @see org.objectweb.kilim.description.TemplateElement#setContainingTemplate(TemplateDescription)
50      */

51     public void setContainingTemplate(TemplateDescription aDescription) throws KilimException {
52         containingTemplate = aDescription;
53     }
54
55     /**
56      * @see java.lang.Object#clone()
57      */

58     public Object JavaDoc clone() {
59         try {
60             return super.clone();
61         } catch (CloneNotSupportedException JavaDoc ex) {
62             System.err.println("Problem during clone operation of element " + this);
63             return null;
64         }
65     }
66 }
67
Popular Tags