final String type = classType.getName();
final BindingConfiguration bindingConfiguration;
if (!isEmpty(lookup)) {
bindingConfiguration = new BindingConfiguration(name, new LookupInjectionSource(lookup));
} else if (type.equals(String.class.getName())) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(value));
} else if (type.equals(Integer.class.getName()) || type.equals("int")) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Integer.valueOf(value)));
} else if (type.equals(Short.class.getName()) || type.equals("short")) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Short.valueOf(value)));
} else if (type.equals(Long.class.getName()) || type.equals("long")) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Long.valueOf(value)));
} else if (type.equals(Byte.class.getName()) || type.equals("byte")) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Byte.valueOf(value)));
} else if (type.equals(Double.class.getName()) || type.equals("double")) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Double.valueOf(value)));
} else if (type.equals(Float.class.getName()) || type.equals("float")) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Float.valueOf(value)));
} else if (type.equals(Boolean.class.getName()) || type.equals("boolean")) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Boolean.valueOf(value)));
} else if (type.equals(Character.class.getName()) || type.equals("char")) {
if (value.length() != 1) {
throw EeLogger.ROOT_LOGGER.invalidCharacterLength("env-entry", value);
}
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(value.charAt(0)));
} else if (type.equals(Class.class.getName())) {
try {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(classLoader.loadClass(value)));
} catch (ClassNotFoundException e) {
throw EeLogger.ROOT_LOGGER.cannotLoad(value);
}
} else if (classType.isEnum() || (classType.getEnclosingClass() != null && classType.getEnclosingClass().isEnum())) {
bindingConfiguration = new BindingConfiguration(name, new EnvEntryInjectionSource(Enum.valueOf((Class) classType, value)));
} else {
throw EeLogger.ROOT_LOGGER.unknownElementType("env-entry", type);
}
bindings.add(bindingConfiguration);
}