EjbEnvEntryValueTypepublic class EjbEnvEntryValueType extends EjbTest implements EjbCheckThe environment entry value type must be one of the following Java types:
String, Integer, Boolean, Double, Byte, Short, Long, and Float. |
Methods Summary |
---|
public com.sun.enterprise.tools.verifier.Result | check(com.sun.enterprise.deployment.EjbDescriptor descriptor)The environment entry value type must be one of the following Java types:
String, Integer, Boolean, Double, Byte, Short, Long, and Float.
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
if (!descriptor.getEnvironmentProperties().isEmpty()) {
// environment entry value type must be one of the following Java types:
// String, Integer, Boolean, Double, Byte, Short, Long, and Float.
for (Iterator itr = descriptor.getEnvironmentProperties().iterator();
itr.hasNext();) {
EnvironmentProperty nextEnvironmentProperty =
(EnvironmentProperty) itr.next();
String envType = nextEnvironmentProperty.getType();
if (!((envType.equals("java.lang.String")) ||
(envType.equals("java.lang.Integer")) ||
(envType.equals("java.lang.Boolean")) ||
(envType.equals("java.lang.Double")) ||
(envType.equals("java.lang.Byte")) ||
(envType.equals("java.lang.Short")) ||
(envType.equals("java.lang.Long")) ||
(envType.equals("java.lang.Character")) ||
(envType.equals("java.lang.Float")))) {
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Environment entry value [ {0} ] does not have" +
" valid value type [ {1} ] within bean [ {2} ]",
new Object[] {nextEnvironmentProperty.getName(),envType, descriptor.getName()}));
}
}
}
if(result.getStatus() != Result.FAILED) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString
(getClass().getName() + ".passed",
"Environment entry value has valid value type"));
}
return result;
|
|