Class DefaultConfigurationBuilder.ConfigurationDeclaration
java.lang.Object
org.apache.commons.configuration.beanutils.XMLBeanDeclaration
org.apache.commons.configuration.DefaultConfigurationBuilder.ConfigurationDeclaration
- All Implemented Interfaces:
BeanDeclaration
- Enclosing class:
DefaultConfigurationBuilder
A specialized BeanDeclaration implementation that
represents the declaration of a configuration source.
Instances of this class are able to extract all information about a
configuration source from the configuration definition file. The
declaration of a configuration source is very similar to a bean
declaration processed by XMLBeanDeclaration. There are
very few differences, e.g. some reserved attributes like
optional and at and the fact that a bean
factory is never needed.
- Since:
- 1.3
- Version:
- $Id: DefaultConfigurationBuilder.java 1366930 2012-07-29 20:05:36Z oheger $
- Author:
- Commons Configuration team
-
Field Summary
Fields inherited from class XMLBeanDeclaration
ATTR_BEAN_CLASS, ATTR_BEAN_FACTORY, ATTR_FACTORY_PARAM, ATTR_PREFIX, RESERVED_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationDeclaration(DefaultConfigurationBuilder builder, HierarchicalConfiguration config) Creates a new instance ofConfigurationDeclarationand initializes it. -
Method Summary
Modifier and TypeMethodDescriptiongetAt()Returns the value of theatattribute.Returns the bean's class name.Returns the name of the bean factory.Returns the associated configuration builder.protected Objectinterpolate(Object value) Performs interpolation.booleanReturns a flag whether this configuration should always be created and added to the resulting combined configuration.booleanReturns a flag whether this is an optional configuration.protected booleanChecks whether the given node is reserved.Methods inherited from class XMLBeanDeclaration
createBeanDeclaration, getBeanFactoryParameter, getBeanProperties, getConfiguration, getNestedBeanDeclarations, getNode
-
Constructor Details
-
ConfigurationDeclaration
public ConfigurationDeclaration(DefaultConfigurationBuilder builder, HierarchicalConfiguration config) Creates a new instance ofConfigurationDeclarationand initializes it.- Parameters:
builder- the associated configuration builderconfig- the configuration this declaration is based onto
-
-
Method Details
-
getConfigurationBuilder
Returns the associated configuration builder.- Returns:
- the configuration builder
-
getAt
-
isOptional
Returns a flag whether this is an optional configuration.- Returns:
- a flag if this declaration points to an optional configuration
-
isForceCreate
Returns a flag whether this configuration should always be created and added to the resulting combined configuration. This flag is evaluated only for optional configurations whose normal creation has caused an error. If for such a configuration theforceCreateattribute is set and the corresponding configuration provider supports this mode, an empty configuration will be created and added to the resulting combined configuration.- Returns:
- the value of the
forceCreateattribute - Since:
- 1.4
-
getBeanFactoryName
Returns the name of the bean factory. For configuration source declarations always a reserved factory is used. This factory's name is returned by this implementation.- Specified by:
getBeanFactoryNamein interfaceBeanDeclaration- Overrides:
getBeanFactoryNamein classXMLBeanDeclaration- Returns:
- the name of the bean factory
-
getBeanClassName
Returns the bean's class name. This implementation will always return null.- Specified by:
getBeanClassNamein interfaceBeanDeclaration- Overrides:
getBeanClassNamein classXMLBeanDeclaration- Returns:
- the name of the bean's class
-
isReservedNode
Checks whether the given node is reserved. This method will take further reserved attributes into account- Overrides:
isReservedNodein classXMLBeanDeclaration- Parameters:
nd- the node- Returns:
- a flag whether this node is reserved
-
interpolate
Performs interpolation. This implementation will delegate interpolation to the configuration builder, which takes care that the currently constructed configuration is taken into account, too.- Overrides:
interpolatein classXMLBeanDeclaration- Parameters:
value- the value to be interpolated- Returns:
- the interpolated value
-