コード例 #1
0
 public String toString() {
   return getClass().getName()
       + "[name="
       + componentDescription.getComponentName()
       + " class="
       + componentDescription.getComponentClassName()
       + "]";
 }
コード例 #2
0
 /**
  * Add a component to this module.
  *
  * @param description the component description
  */
 public void addComponent(ComponentDescription description) {
   final String componentName = description.getComponentName();
   final String componentClassName = description.getComponentClassName();
   if (componentName == null) {
     throw MESSAGES.nullVar("componentName");
   }
   if (componentClassName == null) {
     throw MESSAGES.nullVar("componentClassName");
   }
   if (componentsByName.containsKey(componentName)) {
     throw MESSAGES.componentAlreadyDefined(componentName);
   }
   componentsByName.put(componentName, description);
   List<ComponentDescription> list = componentsByClassName.get(componentClassName);
   if (list == null) {
     componentsByClassName.put(componentClassName, list = new ArrayList<ComponentDescription>(1));
   }
   list.add(description);
 }