If the Bean Provider provides a value for an environment entry using the
env-entry-value element, the value can be changed later by the Application
Assembler or Deployer. The value must be a string that is valid for the
constructor of the specified type that takes a single String parameter.
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
if (!descriptor.getEnvironmentProperties().isEmpty()) {
// The value must be a string that is valid for the
// constructor of the specified type that takes a single String parameter
for (Iterator itr = descriptor.getEnvironmentProperties().iterator();
itr.hasNext();) {
EnvironmentProperty nextEnvironmentProperty =
(EnvironmentProperty) itr.next();
if ((nextEnvironmentProperty.getValue() != null)
&& (nextEnvironmentProperty.getValue().length() > 0)) {
if(!validEnvType(nextEnvironmentProperty)) {
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Environment entry name [ {0} ] does not have" +
" valid value [ {1} ] for constructor of the specified type" +
" [ {2} ] that takes a single String parameter within bean [ {3} ]",
new Object[] {nextEnvironmentProperty.getName(),
nextEnvironmentProperty.getValue(), nextEnvironmentProperty.getType(),
descriptor.getName()}));
}
}
}
}
if(result.getStatus() != Result.FAILED) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString
(getClass().getName() + ".passed",
"Environment entry name has valid value"));
}
return result;