private void validate(String type) {
clearFieldErrors();
if (getName() == null || "".equals(getName())) {
addFieldError(new FactoryURL(getComponentName(), "name"), null, getName());
}
if (type == null || "".equals(type)) {
addFieldError(new FactoryURL(getComponentName(), "jdbc"), null, getType());
addFieldError(new FactoryURL(getComponentName(), "jndi"), null, getType());
} else {
if (type.equals(CUSTOM_TYPE)) {
if (getDriverClass() == null || "".equals(getDriverClass()))
addFieldError(new FactoryURL(getComponentName(), "driverClass"), null, getUrl());
if (getUrl() == null || "".equals(getUrl()))
addFieldError(new FactoryURL(getComponentName(), "url"), null, getUrl());
if (getUserName() == null || "".equals(getUserName()))
addFieldError(new FactoryURL(getComponentName(), "userName"), null, getUserName());
// if (getPassword() == null || "".equals(getPassword()))
// addFieldError(new FactoryURL(getComponentName(), "password"), null, getPassword());
} else if (type.equals(JNDI_TYPE)) {
if (getJndiPath() == null || "".equals(getJndiPath()))
addFieldError(new FactoryURL(getComponentName(), "jndiPath"), null, getJndiPath());
}
}
if (getTestQuery() == null || "".equals(getTestQuery()))
addFieldError(new FactoryURL(getComponentName(), "testQuery"), null, getTestQuery());
}