Commit d45a91b4 authored by helene ortiz's avatar helene ortiz
Browse files

remove DriverNotFoundException

parent 43e47a2d
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package fr.ill.ics.util.exception;
import fr.ill.ics.util.ConfigManager;
/**
*
* @author ortizh
*
*/
public class DriverNotFoundException extends ConfigurationException {
private final static String DEFAULT_MESSAGE = ConfigManager.getInstance().getString("driverNotFoundExceptionMessage");
private String driverName;
public DriverNotFoundException(String driverName, String driverType, String className, String methodName) {
super(DEFAULT_MESSAGE, driverType, null, className, methodName);
this.driverName = driverName;
ConfigManager.getInstance().addConfigurationException(this);
}
private String getDriverName() {
return driverName;
}
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!(object instanceof DriverNotFoundException)) {
return false;
}
DriverNotFoundException controllerNotFoundException = (DriverNotFoundException)object;
if (this.driverName.equals(controllerNotFoundException.getDriverName())) {
if (this.driverName != null) {
return (this.driverName.equals(controllerNotFoundException.getDriverName()));
}
return (this.controllerType.equals(controllerNotFoundException.getControllerType()));
}
return false;
}
public int hashCode() {
return (this.getMessage() + this.getDriverName() + this.getControllerType()).hashCode();
}
protected void addToConfigManager() {
// Already called in constructor => must not do anything
}
public String toString() {
return getMessage() + driverName + (controllerType == null ? "" : " (controller type: " + controllerType +")") + "\n" + getClassName() + ".." + getMethodName();
}
public String format() {
return getMessage() + " " + driverName;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment