1 16 17 package org.springframework.beans.factory.parsing; 18 19 import java.util.LinkedList ; 20 import java.util.List ; 21 22 import org.springframework.util.Assert; 23 24 33 public class CompositeComponentDefinition extends AbstractComponentDefinition { 34 35 private final String name; 36 37 private final Object source; 38 39 private final List nestedComponents = new LinkedList (); 40 41 42 47 public CompositeComponentDefinition(String name, Object source) { 48 Assert.notNull(name, "Name must not be null"); 49 this.name = name; 50 this.source = source; 51 } 52 53 54 public String getName() { 55 return this.name; 56 } 57 58 public Object getSource() { 59 return this.source; 60 } 61 62 63 67 public void addNestedComponent(ComponentDefinition component) { 68 Assert.notNull(component, "ComponentDefinition must not be null"); 69 this.nestedComponents.add(component); 70 } 71 72 76 public ComponentDefinition[] getNestedComponents() { 77 return (ComponentDefinition[]) 78 this.nestedComponents.toArray(new ComponentDefinition[this.nestedComponents.size()]); 79 } 80 81 } 82 | Popular Tags |