Top Description Inners Fields Constructors Methods
org.springframework.context.annotation

pack-priv final Class ConfigurationClass

extends Object
Class Inheritance
Imports
java.util.HashSet, .LinkedHashMap, .LinkedHashSet, .Map, .Set, org.springframework.beans.factory.parsing.Location, .Problem, .ProblemReporter, org.springframework.beans.factory.support.BeanDefinitionReader, org.springframework.core.io.DescriptiveResource, .Resource, org.springframework.core.type.AnnotationMetadata, .MethodMetadata, org.springframework.core.type.classreading.MetadataReader, org.springframework.lang.Nullable, org.springframework.util.Assert, .ClassUtils

Represents a user-defined @Configuration class.

Includes a set of Bean methods, including all such methods defined in the ancestry of the class, in a 'flattened-out' manner.

Authors
Chris Beams, Juergen Hoeller, Phillip Webb
Since
3.0
See Also
BeanMethod, ConfigurationClassParser

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
ConfigurationClass.BeanMethodOverloadingProblem

Configuration classes are not allowed to contain overloaded bean methods by default (as of 6.0).

private class
ConfigurationClass.FinalConfigurationProblem

Configuration classes must be non-final to accommodate CGLIB subclassing.

Field Summary

Modifier and TypeField and Description
private final Set<BeanMethod>
private String
private final Map<ImportBeanDefinitionRegistrar, AnnotationMetadata>
private final Set<ConfigurationClass>
private final Map<String, Class<? extends BeanDefinitionReader>>
private final AnnotationMetadata
private final Resource
pack-priv final Set<String>

Constructor Summary

AccessConstructor and Description
pack-priv
ConfigurationClass(MetadataReader
reader used to parse the underlying Class
metadataReader
,
String
must not be null
beanName
)

Create a new ConfigurationClass with the given name.

pack-priv
ConfigurationClass(MetadataReader
reader used to parse the underlying Class
metadataReader
,
ConfigurationClass
the configuration class importing this one or null
importedBy
)

Create a new ConfigurationClass representing a class that was imported using the Import annotation or automatically processed as a nested configuration class (if importedBy is not null).

pack-priv
ConfigurationClass(Class<?>
the underlying Class to represent
clazz
,
String
name of the @Configuration class bean
beanName
)

Create a new ConfigurationClass with the given name.

pack-priv
ConfigurationClass(Class<?>
the underlying Class to represent
clazz
,
ConfigurationClass
the configuration class importing this one (or null)
importedBy
)

Create a new ConfigurationClass representing a class that was imported using the Import annotation or automatically processed as a nested configuration class (if imported is true).

pack-priv
ConfigurationClass(AnnotationMetadata
the metadata for the underlying class to represent
metadata
,
String
name of the @Configuration class bean
beanName
)

Create a new ConfigurationClass with the given name.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv void
addImportedResource(String importedResource, Class<? extends BeanDefinitionReader> readerClass)

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

pack-priv Set<BeanMethod>
public String
pack-priv Map<ImportBeanDefinitionRegistrar, AnnotationMetadata>
pack-priv Set<ConfigurationClass>
getImportedBy()

Return the configuration classes that imported this class, or an empty Set if this configuration was not imported.

pack-priv Map<String, Class<? extends BeanDefinitionReader>>
pack-priv AnnotationMetadata
pack-priv Resource
pack-priv String
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isImported()

Return whether this configuration class was registered via @Import or automatically registered due to being nested within another configuration class.

pack-priv void
mergeImportedBy(ConfigurationClass otherConfigClass)

Merge the imported-by declarations from the given configuration class into this one.

pack-priv void
setBeanName(String beanName)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

pack-priv void
validate(ProblemReporter problemReporter)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

beanMethodsback to summary
private final Set<BeanMethod> beanMethods
beanNameback to summary
private String beanName
Annotations
@Nullable
importBeanDefinitionRegistrarsback to summary
private final Map<ImportBeanDefinitionRegistrar, AnnotationMetadata> importBeanDefinitionRegistrars
importedByback to summary
private final Set<ConfigurationClass> importedBy
importedResourcesback to summary
private final Map<String, Class<? extends BeanDefinitionReader>> importedResources
metadataback to summary
private final AnnotationMetadata metadata
resourceback to summary
private final Resource resource
skippedBeanMethodsback to summary
pack-priv final Set<String> skippedBeanMethods

Constructor Detail

ConfigurationClassback to summary
pack-priv ConfigurationClass(MetadataReader metadataReader, String beanName)

Create a new ConfigurationClass with the given name.

Parameters
metadataReader:MetadataReader

reader used to parse the underlying Class

beanName:String

must not be null

See Also
ConfigurationClass#ConfigurationClass(Class, ConfigurationClass)
ConfigurationClassback to summary
pack-priv ConfigurationClass(MetadataReader metadataReader, ConfigurationClass importedBy)

Create a new ConfigurationClass representing a class that was imported using the Import annotation or automatically processed as a nested configuration class (if importedBy is not null).

Parameters
metadataReader:MetadataReader

reader used to parse the underlying Class

importedBy:ConfigurationClass

the configuration class importing this one or null

Since
3.1.1
ConfigurationClassback to summary
pack-priv ConfigurationClass(Class<?> clazz, String beanName)

Create a new ConfigurationClass with the given name.

Parameters
clazz:Class<?>

the underlying Class to represent

beanName:String

name of the @Configuration class bean

See Also
ConfigurationClass#ConfigurationClass(Class, ConfigurationClass)
ConfigurationClassback to summary
pack-priv ConfigurationClass(Class<?> clazz, ConfigurationClass importedBy)

Create a new ConfigurationClass representing a class that was imported using the Import annotation or automatically processed as a nested configuration class (if imported is true).

Parameters
clazz:Class<?>

the underlying Class to represent

importedBy:ConfigurationClass

the configuration class importing this one (or null)

Since
3.1.1
ConfigurationClassback to summary
pack-priv ConfigurationClass(AnnotationMetadata metadata, String beanName)

Create a new ConfigurationClass with the given name.

Parameters
metadata:AnnotationMetadata

the metadata for the underlying class to represent

beanName:String

name of the @Configuration class bean

See Also
ConfigurationClass#ConfigurationClass(Class, ConfigurationClass)

Method Detail

addBeanMethodback to summary
pack-priv void addBeanMethod(BeanMethod method)
addImportBeanDefinitionRegistrarback to summary
pack-priv void addImportBeanDefinitionRegistrar(ImportBeanDefinitionRegistrar registrar, AnnotationMetadata importingClassMetadata)
addImportedResourceback to summary
pack-priv void addImportedResource(String importedResource, Class<? extends BeanDefinitionReader> readerClass)
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getBeanMethodsback to summary
pack-priv Set<BeanMethod> getBeanMethods()
getBeanNameback to summary
public String getBeanName()
Annotations
@Nullable
getImportBeanDefinitionRegistrarsback to summary
pack-priv Map<ImportBeanDefinitionRegistrar, AnnotationMetadata> getImportBeanDefinitionRegistrars()
getImportedByback to summary
pack-priv Set<ConfigurationClass> getImportedBy()

Return the configuration classes that imported this class, or an empty Set if this configuration was not imported.

Since
4.0.5
See Also
isImported()
getImportedResourcesback to summary
pack-priv Map<String, Class<? extends BeanDefinitionReader>> getImportedResources()
getMetadataback to summary
pack-priv AnnotationMetadata getMetadata()
getResourceback to summary
pack-priv Resource getResource()
getSimpleNameback to summary
pack-priv String getSimpleName()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isImportedback to summary
public boolean isImported()

Return whether this configuration class was registered via @Import or automatically registered due to being nested within another configuration class.

Since
3.1.1
See Also
getImportedBy()
mergeImportedByback to summary
pack-priv void mergeImportedBy(ConfigurationClass otherConfigClass)

Merge the imported-by declarations from the given configuration class into this one.

Since
4.0.5
setBeanNameback to summary
pack-priv void setBeanName(String beanName)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
validateback to summary
pack-priv void validate(ProblemReporter problemReporter)
org.springframework.context.annotation back to summary

private Class ConfigurationClass.BeanMethodOverloadingProblem

extends Problem
Class Inheritance

Configuration classes are not allowed to contain overloaded bean methods by default (as of 6.0).

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from org.springframework.beans.factory.parsing.Problem:
getLocationgetMessagegetParseStategetResourceDescriptiongetRootCausetoString

Constructor Detail

BeanMethodOverloadingProblemback to summary
pack-priv BeanMethodOverloadingProblem(String methodName)
org.springframework.context.annotation back to summary

private Class ConfigurationClass.FinalConfigurationProblem

extends Problem
Class Inheritance

Configuration classes must be non-final to accommodate CGLIB subclassing.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from org.springframework.beans.factory.parsing.Problem:
getLocationgetMessagegetParseStategetResourceDescriptiongetRootCausetoString

Constructor Detail

FinalConfigurationProblemback to summary
pack-priv FinalConfigurationProblem()