Top Description Fields Constructors Methods
org.springframework.beans.factory.parsing

public Class CompositeComponentDefinition

extends AbstractComponentDefinition
Class Inheritance
Imports
java.util.ArrayList, .List, org.springframework.lang.Nullable, org.springframework.util.Assert

ComponentDefinition implementation that holds one or more nested ComponentDefinition instances, aggregating them into a named group of components.
Author
Juergen Hoeller
Since
2.0.1
See Also
getNestedComponents()

Field Summary

Modifier and TypeField and Description
private final String
private final List<ComponentDefinition>
private final Object

Constructor Summary

AccessConstructor and Description
public
CompositeComponentDefinition(String
the name of the composite component
name
,
Object
the source element that defines the root of the composite component
source
)

Create a new CompositeComponentDefinition.

Method Summary

Modifier and TypeMethod and Description
public void
addNestedComponent(ComponentDefinition
the nested component to add
component
)

Add the given component as nested element of this composite component.

public String
getName()

Implements org.springframework.beans.factory.parsing.ComponentDefinition.getName.

Get the user-visible name of this ComponentDefinition.

public ComponentDefinition[]

Returns:

the array of nested components, or an empty array if none
getNestedComponents
()

Return the nested components that this composite component holds.

public Object
getSource()

Overrides default org.springframework.beans.BeanMetadataElement.getSource.

Return the configuration source Object for this metadata element (may be null).

Inherited from org.springframework.beans.factory.parsing.AbstractComponentDefinition:
getBeanDefinitionsgetBeanReferencesgetDescriptiongetInnerBeanDefinitionstoString

Field Detail

nameback to summary
private final String name
nestedComponentsback to summary
private final List<ComponentDefinition> nestedComponents
sourceback to summary
private final Object source
Annotations
@Nullable

Constructor Detail

CompositeComponentDefinitionback to summary
public CompositeComponentDefinition(String name, Object source)

Create a new CompositeComponentDefinition.

Parameters
name:String

the name of the composite component

source:Object

the source element that defines the root of the composite component

Method Detail

addNestedComponentback to summary
public void addNestedComponent(ComponentDefinition component)

Add the given component as nested element of this composite component.

Parameters
component:ComponentDefinition

the nested component to add

getNameback to summary
public String getName()

Implements org.springframework.beans.factory.parsing.ComponentDefinition.getName.

Doc from org.springframework.beans.factory.parsing.ComponentDefinition.getName.

Get the user-visible name of this ComponentDefinition.

This should link back directly to the corresponding configuration data for this component in a given context.

Annotations
@Override
getNestedComponentsback to summary
public ComponentDefinition[] getNestedComponents()

Return the nested components that this composite component holds.

Returns:ComponentDefinition[]

the array of nested components, or an empty array if none

getSourceback to summary
public Object getSource()

Overrides default org.springframework.beans.BeanMetadataElement.getSource.

Doc from org.springframework.beans.BeanMetadataElement.getSource.

Return the configuration source Object for this metadata element (may be null).

Annotations
@Override
@Nullable