io
Class AbstractDriver
java.lang.Object
util.PropertyContainer
io.AbstractDriver
- All Implemented Interfaces:
- Driver, Cloneable, Initializable, PropertyBearing
- Direct Known Subclasses:
- AbstractCcdDriver, AbstractPilarDriver, AbstractSerialDriver, AbstractSocketDriver, BaaderDome, PythonClient, UpsDriver
public abstract class AbstractDriver
- extends PropertyContainer
- implements Driver
An abstract implementation of a Driver. Mainly used for it's
static createDriver(java.util.Map) method.
|
Method Summary |
static Driver |
createDriver(Map<String,String> prop)
Creates a new driver instance using the class key found in the
properties. |
boolean |
equals(Object driver)
Two drivers are equal if their class is equal and their names match |
String |
getDriverName()
All drivers should provide a property named #KEY_DIVERNAME. |
int |
hashCode()
Hashin is done with the driver name. |
| Methods inherited from class util.PropertyContainer |
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, init, isNew, keyCreate, keyCreate, parseObject, reload, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
KEY_DRIVERNAME
public static final String KEY_DRIVERNAME
- The name of this driver if explicedly set.
- See Also:
- Constant Field Values
AbstractDriver
protected AbstractDriver(Map info)
- Constructs a new driver. Use of this constructor ensures that the
PropertyBearing.KEY_CLASS property is always set.
getDriverName
public String getDriverName()
- All drivers should provide a property named
#KEY_DIVERNAME. If
it is not set, we return the class name here.
- Specified by:
getDriverName in interface Driver
equals
public boolean equals(Object driver)
- Two drivers are equal if their class is equal and their names match
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Hashin is done with the driver name.
- Overrides:
hashCode in class Object
createDriver
public static final Driver createDriver(Map<String,String> prop)
- Creates a new driver instance using the class key found in the
properties. If the
PropertyBearing.KEY_CLASS
property is defined, a new driver with the stated class name is
created, the supplied properties used as an argument in the
constructor.