Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api.db.xml.types
Class TLptsODBCDriverType

java.lang.Object
  extended by com.lapetus_ltd._2009.xml.types.XLptsODBCDriverType
      extended by com.lapetus_ltd.api.db.xml.types.TLptsODBCDriverType

public class TLptsODBCDriverType
extends XLptsODBCDriverType

Class Description :


$LastChangedRevision: 1190 $
$LastChangedDate:: 2010-11-17 13:21:35#$


Field Summary
 
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsODBCDriverType
driverListItem, osName
 
Constructor Summary
TLptsODBCDriverType()
           This constructor initiates the OsName and the driver list.
TLptsODBCDriverType(XLptsODBCDriverType systemDriverType)
           This constructor copies the driver information from an XLptsODBCDriverType.
 
Method Summary
 void addDriverListItem(XLptsDriverExtensionSubType dest)
           Adds the driver extension sub type to the driver list.
 boolean equals(java.lang.Object obj)
           Check for equal TLptsODBCDriverType objects.
 java.util.List<XLptsDriverExtensionSubType> getDriverListItem()
           Returns a copy of the actual list.
 int getDriverListItemSize()
           Returns the size of the actual list.
 void removeDriverListItem(XLptsDriverExtensionSubType dest)
           Removes the driver extension sub type from the driver extension list.
 
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsODBCDriverType
getOsName, setOsName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLptsODBCDriverType

public TLptsODBCDriverType()

This constructor initiates the OsName and the driver list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Default Constructor set OsName to empty string and initialize the driver list.

Example :

 

//Load a projectType from XML file XLptsDBProjectType projectType = (XLptsDBProjectType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDBProjectType.class); //Now we want to create a new TLptsDBProjectType from the XLptsDBProjectType. Also we want to add a new Driver Extension Sub Type TLptsDBProjectType projectSettings = new TLptsDBProjectType(projectType);

TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(); dest.setDriverName("Microsoft Access Driver (*.mdb, *.accdb)"); dest.setExtension("mdb"); //Or load from a file //XLptsDriverExtensionSubType xdest = (XLptsDriverExtensionSubType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDriverExtensionSubType.class); //TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(xdest);

//Finally add driver extension sub type to the list ((TLptsODBCDriverType) projectSettings.getOsDriver()).addDriverListItem(dest);


TLptsODBCDriverType

public TLptsODBCDriverType(XLptsODBCDriverType systemDriverType)

This constructor copies the driver information from an XLptsODBCDriverType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Use this function every time you need to copy or instantiate a type XLptsODBCDriverType class.

Example :

 

//Load a projectType from XML file XLptsDBProjectType projectType = (XLptsDBProjectType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDBProjectType.class); //Now we want to create a new TLptsDBProjectType from the XLptsDBProjectType. Also we want to add a new Driver Extension Sub Type TLptsDBProjectType projectSettings = new TLptsDBProjectType(projectType);

TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(); dest.setDriverName("Microsoft Access Driver (*.mdb, *.accdb)"); dest.setExtension("mdb"); //Or load from a file //XLptsDriverExtensionSubType xdest = (XLptsDriverExtensionSubType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDriverExtensionSubType.class); //TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(xdest);

//Finally add driver extension sub type to the list ((TLptsODBCDriverType) projectSettings.getOsDriver()).addDriverListItem(dest);

Parameters:
systemDriverType - the class object to copy.
Method Detail

addDriverListItem

public void addDriverListItem(XLptsDriverExtensionSubType dest)

Adds the driver extension sub type to the driver list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to add to the list. Getting the list with getDriverListItem and
then adding does not have any affect.

Example :

 

//Load a projectType from XML file XLptsDBProjectType projectType = (XLptsDBProjectType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDBProjectType.class); //Now we want to create a new TLptsDBProjectType from the XLptsDBProjectType. Also we want to add a new Driver Extension Sub Type TLptsDBProjectType projectSettings = new TLptsDBProjectType(projectType);

TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(); dest.setDriverName("Microsoft Access Driver (*.mdb, *.accdb)"); dest.setExtension("mdb"); //Or load from a file //XLptsDriverExtensionSubType xdest = (XLptsDriverExtensionSubType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDriverExtensionSubType.class); //TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(xdest);

if(((TLptsODBCDriverType) projectSettings.getOsDriver()).getDriverListItemSize()>0) { if(((TLptsODBCDriverType) projectSettings.getOsDriver()).getDriverListItem().contains(dest)) ((TLptsODBCDriverType) projectSettings.getOsDriver()).removeDriverListItem(dest); //Finally add driver extension sub type to the list ((TLptsODBCDriverType) projectSettings.getOsDriver()).addDriverListItem(dest); }

Parameters:
dest - the driver extension sub type to add in the list.

equals

public boolean equals(java.lang.Object obj)

Check for equal TLptsODBCDriverType objects.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to compare two TLptsODBCDriverType objects by there osName.

Example :

 

Overrides:
equals in class java.lang.Object
Parameters:
obj - the odbc driver type
Returns:
true if they are equal, else false.

getDriverListItem

public java.util.List<XLptsDriverExtensionSubType> getDriverListItem()

Returns a copy of the actual list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not add to this list as there is no result. Use the addDriverListItem function.

Example :

 

//Load a projectType from XML file XLptsDBProjectType projectType = (XLptsDBProjectType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDBProjectType.class); //Now we want to create a new TLptsDBProjectType from the XLptsDBProjectType. Also we want to add a new Driver Extension Sub Type TLptsDBProjectType projectSettings = new TLptsDBProjectType(projectType);

TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(); dest.setDriverName("Microsoft Access Driver (*.mdb, *.accdb)"); dest.setExtension("mdb"); //Or load from a file //XLptsDriverExtensionSubType xdest = (XLptsDriverExtensionSubType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDriverExtensionSubType.class); //TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(xdest);

if(((TLptsODBCDriverType) projectSettings.getOsDriver()).getDriverListItemSize()>0) { if(((TLptsODBCDriverType) projectSettings.getOsDriver()).getDriverListItem().contains(dest)) ((TLptsODBCDriverType) projectSettings.getOsDriver()).removeDriverListItem(dest); //Finally add driver extension sub type to the list ((TLptsODBCDriverType) projectSettings.getOsDriver()).addDriverListItem(dest); }

Overrides:
getDriverListItem in class XLptsODBCDriverType
Returns:
Returns a list of odbc drivers.

getDriverListItemSize

public int getDriverListItemSize()

Returns the size of the actual list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not use getDriverListItem().size() as it is not efficient.

Example :

 

//Load a projectType from XML file XLptsDBProjectType projectType = (XLptsDBProjectType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDBProjectType.class); //Now we want to create a new TLptsDBProjectType from the XLptsDBProjectType. Also we want to add a new Driver Extension Sub Type TLptsDBProjectType projectSettings = new TLptsDBProjectType(projectType);

TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(); dest.setDriverName("Microsoft Access Driver (*.mdb, *.accdb)"); dest.setExtension("mdb"); //Or load from a file //XLptsDriverExtensionSubType xdest = (XLptsDriverExtensionSubType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDriverExtensionSubType.class); //TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(xdest);

if(((TLptsODBCDriverType) projectSettings.getOsDriver()).getDriverListItemSize()>0) { if(((TLptsODBCDriverType) projectSettings.getOsDriver()).getDriverListItem().contains(dest)) ((TLptsODBCDriverType) projectSettings.getOsDriver()).removeDriverListItem(dest); //Finally add driver extension sub type to the list ((TLptsODBCDriverType) projectSettings.getOsDriver()).addDriverListItem(dest); }

Returns:
Returns the number of connections.

removeDriverListItem

public void removeDriverListItem(XLptsDriverExtensionSubType dest)

Removes the driver extension sub type from the driver extension list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to remove from the list. Getting the list with getDriverListItem and
then removing does not have any affect.

Example :

 

//Load a projectType from XML file XLptsDBProjectType projectType = (XLptsDBProjectType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDBProjectType.class); //Now we want to create a new TLptsDBProjectType from the XLptsDBProjectType. Also we want to add a new Driver Extension Sub Type TLptsDBProjectType projectSettings = new TLptsDBProjectType(projectType);

TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(); dest.setDriverName("Microsoft Access Driver (*.mdb, *.accdb)"); dest.setExtension("mdb"); //Or load from a file //XLptsDriverExtensionSubType xdest = (XLptsDriverExtensionSubType) TLptsXmlUtil.unmarshal(selectedFile,XLptsDriverExtensionSubType.class); //TLptsDriverExtensionSubType dest = new TLptsDriverExtensionSubType(xdest);

if(((TLptsODBCDriverType) projectSettings.getOsDriver()).getDriverListItemSize()>0) { if(((TLptsODBCDriverType) projectSettings.getOsDriver()).getDriverListItem().contains(dest)) ((TLptsODBCDriverType) projectSettings.getOsDriver()).removeDriverListItem(dest); //Finally add driver extension sub type to the list ((TLptsODBCDriverType) projectSettings.getOsDriver()).addDriverListItem(dest); }

Parameters:
dest - the driver extension sub type to remove from list.


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)