public class ConfigurationDeclaration extends XMLBeanDeclaration
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.
ATTR_BEAN_CLASS, ATTR_BEAN_FACTORY, ATTR_FACTORY_PARAM, ATTR_PREFIX, RESERVED_PREFIX
Constructor and Description |
---|
ConfigurationDeclaration(CombinedConfigurationBuilder builder,
HierarchicalConfiguration<?> config)
Creates a new instance of
ConfigurationDeclaration and
initializes it. |
Modifier and Type | Method and Description |
---|---|
String |
getAt()
Returns the value of the
at attribute. |
String |
getBeanClassName()
Returns the bean's class name.
|
String |
getBeanFactoryName()
Returns the name of the bean factory.
|
CombinedConfigurationBuilder |
getConfigurationBuilder()
Returns the associated configuration builder.
|
String |
getName()
Returns the name for the represented configuration source.
|
boolean |
isForceCreate()
Returns a flag whether this configuration should always be created and
added to the resulting combined configuration.
|
boolean |
isOptional()
Returns a flag whether this is an optional configuration.
|
boolean |
isReload()
Returns a flag whether a builder with reloading support should be
created.
|
protected boolean |
isReservedAttributeName(String name)
Checks if the specified attribute name is reserved and thus does not
point to a property of the bean to be created.
|
getAttributeNames, getBeanFactoryParameter, getBeanProperties, getConfiguration, getConstructorArgs, getDefaultBeanClassName, getNestedBeanDeclarations, interpolate, isReservedChildName, isReservedName
public ConfigurationDeclaration(CombinedConfigurationBuilder builder, HierarchicalConfiguration<?> config)
ConfigurationDeclaration
and
initializes it.builder
- the associated configuration builderconfig
- the configuration this declaration is based ontopublic CombinedConfigurationBuilder getConfigurationBuilder()
public String getAt()
at
attribute.at
attribute (can be null)public boolean isOptional()
public boolean isForceCreate()
forceCreate
attribute is
set and the corresponding configuration provider supports this mode, an
empty configuration will be created and added to the resulting combined
configuration.forceCreate
attributepublic boolean isReload()
public String getName()
public String getBeanFactoryName()
getBeanFactoryName
in interface BeanDeclaration
getBeanFactoryName
in class XMLBeanDeclaration
public String getBeanClassName()
getBeanClassName
in interface BeanDeclaration
getBeanClassName
in class XMLBeanDeclaration
protected boolean isReservedAttributeName(String name)
XMLBeanDeclaration.isReservedName(String)
. This implementation checks for additional reserved
attribute names. Note that in some cases the presence of other attribute
names determine whether a name is reserved or not. For instance, per
default the attribute config-at
is reserved. However, if this
attribute is not present, the attribute at
is also considered as
a reserved attribute. (This is mainly done for dealing with legacy
configuration files supported by earlier versions of this library.)isReservedAttributeName
in class XMLBeanDeclaration
name
- the name of the attribute to be checkedCopyright © 2001–2020 The Apache Software Foundation. All rights reserved.