1 package org.objectweb.kilim.description; 2 3 import java.util.Iterator ; 4 5 import org.objectweb.kilim.InternalException; 6 import org.objectweb.kilim.KilimException; 7 8 12 public abstract class TemplateElementImpl implements TemplateElement { 13 private TemplateDescription containingTemplate; 14 15 19 protected TemplateElementImpl(TemplateDescription aTemplate) { 20 containingTemplate = aTemplate; 21 } 22 23 26 protected TemplateElementImpl() { 27 this(null); 28 } 29 30 33 public TemplateDescription getContainingTemplate() { 34 return containingTemplate; 35 } 36 37 40 public Iterator getTemplateDefHierarchy() { 41 try { 42 return getContainingTemplate().getTemplateDefHierarchy(this); 43 } catch (KilimException ex) { 44 throw new InternalException(ex); 45 } 46 } 47 48 51 public void setContainingTemplate(TemplateDescription aDescription) throws KilimException { 52 containingTemplate = aDescription; 53 } 54 55 58 public Object clone() { 59 try { 60 return super.clone(); 61 } catch (CloneNotSupportedException ex) { 62 System.err.println("Problem during clone operation of element " + this); 63 return null; 64 } 65 } 66 } 67 | Popular Tags |