io
Class AbstractDriver

java.lang.Object
  extended by util.PropertyContainer
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
static String KEY_DRIVERNAME
          The name of this driver if explicedly set.
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractDriver(Map info)
          Constructs a new driver.
 
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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface io.Driver
close, isOpen, open
 

Field Detail

KEY_DRIVERNAME

public static final String KEY_DRIVERNAME
The name of this driver if explicedly set.

See Also:
Constant Field Values
Constructor Detail

AbstractDriver

protected AbstractDriver(Map info)
Constructs a new driver. Use of this constructor ensures that the PropertyBearing.KEY_CLASS property is always set.

Method Detail

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.