Class CompositeComponentDefinition
- java.lang.Object
- org.springframework.beans.factory.parsing.AbstractComponentDefinition
- org.springframework.beans.factory.parsing.CompositeComponentDefinition
- All Implemented Interfaces:
BeanMetadataElement,ComponentDefinition
- Direct Known Subclasses:
AspectComponentDefinition
public class CompositeComponentDefinition extends AbstractComponentDefinition
ComponentDefinitionimplementation that holds one or more nestedComponentDefinitioninstances, aggregating them into a named group of components.- Since:
- 2.0.1
- Author:
- Juergen Hoeller
- See Also:
getNestedComponents()
Constructor Summary
Constructors Constructor Description CompositeComponentDefinition(String name, Object source)Create a new CompositeComponentDefinition.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNestedComponent(ComponentDefinition component)Add the given component as nested element of this composite component.StringgetName()Get the user-visible name of thisComponentDefinition.ComponentDefinition[]getNestedComponents()Return the nested components that this composite component holds.ObjectgetSource()Return the configuration sourceObjectfor this metadata element (may benull).Methods inherited from class org.springframework.beans.factory.parsing.AbstractComponentDefinition
getBeanDefinitions, getBeanReferences, getDescription, getInnerBeanDefinitions, toString
Constructor Detail
CompositeComponentDefinition
public CompositeComponentDefinition(String name, Object source)
Create a new CompositeComponentDefinition.- Parameters:
name- the name of the composite componentsource- the source element that defines the root of the composite component
Method Detail
getName
public String getName()
Description copied from interface:ComponentDefinitionGet the user-visible name of thisComponentDefinition.This should link back directly to the corresponding configuration data for this component in a given context.
getSource
public Object getSource()
Description copied from interface:BeanMetadataElementReturn the configuration sourceObjectfor this metadata element (may benull).
addNestedComponent
public void addNestedComponent(ComponentDefinition component)
Add the given component as nested element of this composite component.- Parameters:
component- the nested component to add
getNestedComponents
public ComponentDefinition[] getNestedComponents()
Return the nested components that this composite component holds.- Returns:
- the array of nested components, or an empty array if none