1 64 package com.jcorporate.expresso.kernel; 65 66 import com.jcorporate.expresso.kernel.metadata.ComponentMetadata; 67 68 import java.net.URL ; 69 70 80 abstract public class ComponentBase implements ExpressoComponent, Describable { 81 82 85 private Containable parent = null; 86 87 90 private ComponentMetadata metadata = null; 91 92 93 96 public ComponentBase() { 97 } 98 99 104 public ComponentBase(Containable parent) { 105 this.parent = parent; 106 } 107 108 113 public synchronized ComponentMetadata getMetaData() { 114 return metadata; 115 } 116 117 122 public synchronized Containable getParent() { 123 return parent; 124 } 125 126 131 public synchronized void setParent(Containable parent) { 132 this.parent = parent; 133 } 134 135 140 public synchronized void setMetaData(ComponentMetadata metadata) { 141 this.metadata = metadata; 142 } 143 144 151 public synchronized URL getMetadataLocation() { 152 String className = this.getClass().getName(); 153 int spliceLoc = className.lastIndexOf("."); 154 className = className.substring(spliceLoc + 1); 155 return this.getClass().getResource(className + ".xml"); 156 } 157 158 } | Popular Tags |