|
From: Colin S. <col...@ex...> - 2004-06-30 22:55:11
|
I'm trying to figure out why the DTD allows both 'none' and 'default'
for the dependency-check attribute.
<!--
Optional attribute controlling whether to check whether all this
beans dependencies, expressed in its properties, are satisfied.
Default is no dependency checking.
"simple" type dependency checking includes primitives and String
"object" includes collaborators (other beans in the factory)
"all" includes both types of dependency checking
-->
<!ATTLIST bean dependency-check (none | objects | simple | all |
default) "default">
If you look at the code, none is the default (when nothing is
specified). 'default gets treated exactly like none, but it seems almost
like an accident.
protected int getDependencyCheck(String att) {
int dependencyCheckCode = RootBeanDefinition.DEPENDENCY_CHECK_NONE;
if (DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE.equals(att)) {
dependencyCheckCode = RootBeanDefinition.DEPENDENCY_CHECK_ALL;
}
else if (DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE.equals(att)) {
dependencyCheckCode =
RootBeanDefinition.DEPENDENCY_CHECK_SIMPLE;
}
else if (DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE.equals(att)) {
dependencyCheckCode =
RootBeanDefinition.DEPENDENCY_CHECK_OBJECTS;
}
// else leave default value
return dependencyCheckCode;
}
Is 'default' still needed?
Colin
|