proper.database
Class ColumnLister

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.database.ConnectorObject
          extended by proper.database.ExecutorObject
              extended by proper.database.ColumnLister
All Implemented Interfaces:
ProperInterface, Lister

public class ColumnLister
extends ExecutorObject
implements Lister

This class retrieves a list of column names for a given table.

Version:
$Revision: 1.4 $
Author:
FracPete

Field Summary
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
ColumnLister(Connector conn)
          initializes the object
ColumnLister(Connector conn, java.lang.String table)
          initializes the object
 
Method Summary
 void clear()
          resets the setting to default, i.e.
 boolean getAddTable()
          returns whether the table is added in front of the column name
 java.util.Vector getColumnNamesForImportedKey(java.lang.String colName)
          determines the name(s) of the column in the current table which resembles the given imported (i.e.
 java.util.Vector getList()
          retrieves the list of column names and returns them in a Vector
 boolean getOnlyExportedKeys()
          returns whether only exported keys are returned
 boolean getOnlyImportedKeys()
          returns whether only imported keys are returned
 boolean getOnlyIndexes()
          returns whether only indexes are returned
 boolean getOnlyNominal()
          returns whether only nominal fields are returned
 boolean getOnlyPrimary()
          returns whether only primary indexes are returned
 boolean getOnlySimpleTypes()
          returns whether only simple type fields are returned (i.e.
 boolean getSort()
          returns whether the fields are sorted or not
 java.lang.String getTable()
          returns the name of the table to read from
 void setAddTable(boolean value)
          sets whether to add the table name in front of the column name
 void setExcludes(java.lang.String excludes)
          sets the fields (String) to exclude from export
 void setExcludes(java.util.Vector excludes)
          sets the fields (String) to exclude from export
 void setOnlyExportedKeys(boolean value)
          sets whether to retrieve only exported keys.
 void setOnlyImportedKeys(boolean value)
          sets whether to retrieve only imported keys
 void setOnlyIndexes(boolean value)
          sets whether to retrieve only indexes
 void setOnlyNominal(boolean value)
          sets whether to retrieve only nominal fields
 void setOnlyPrimary(boolean value)
          sets whether to retrieve only primary indexes
 void setOnlySimpleTypes(boolean value)
          sets whether to retrieve only simple type fields (i.e.
 void setSort(boolean sort)
          sets whether to sort the fields or not
 void setTable(java.lang.String table)
          sets the name of the table to use
 java.lang.String toString()
          returns the current setting in a string representation
 
Methods inherited from class proper.database.ExecutorObject
getExecutor, getLastException, getLastStatement
 
Methods inherited from class proper.database.ConnectorObject
getConnector
 
Methods inherited from class proper.core.ProperObject
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnLister

public ColumnLister(Connector conn)
initializes the object

Parameters:
conn - the Connector used for Database-Handling

ColumnLister

public ColumnLister(Connector conn,
                    java.lang.String table)
initializes the object

Parameters:
conn - the Connector used for Database-Handling
table - the table to use for reading
Method Detail

clear

public void clear()
resets the setting to default, i.e. all columns and that unsorted

Specified by:
clear in interface Lister

setTable

public void setTable(java.lang.String table)
sets the name of the table to use


getTable

public java.lang.String getTable()
returns the name of the table to read from


setSort

public void setSort(boolean sort)
sets whether to sort the fields or not

Specified by:
setSort in interface Lister

getSort

public boolean getSort()
returns whether the fields are sorted or not

Specified by:
getSort in interface Lister

setAddTable

public void setAddTable(boolean value)
sets whether to add the table name in front of the column name


getAddTable

public boolean getAddTable()
returns whether the table is added in front of the column name


setOnlyNominal

public void setOnlyNominal(boolean value)
sets whether to retrieve only nominal fields


getOnlyNominal

public boolean getOnlyNominal()
returns whether only nominal fields are returned


setOnlySimpleTypes

public void setOnlySimpleTypes(boolean value)
sets whether to retrieve only simple type fields (i.e. none of type OTHER)

See Also:
Types.OTHER

getOnlySimpleTypes

public boolean getOnlySimpleTypes()
returns whether only simple type fields are returned (i.e. none of type OTHER).

See Also:
Types.OTHER

setOnlyIndexes

public void setOnlyIndexes(boolean value)
sets whether to retrieve only indexes


getOnlyIndexes

public boolean getOnlyIndexes()
returns whether only indexes are returned


setOnlyPrimary

public void setOnlyPrimary(boolean value)
sets whether to retrieve only primary indexes


getOnlyPrimary

public boolean getOnlyPrimary()
returns whether only primary indexes are returned


setOnlyExportedKeys

public void setOnlyExportedKeys(boolean value)
sets whether to retrieve only exported keys. automatically sets setAddTable(true).

See Also:
setAddTable(boolean)

getOnlyExportedKeys

public boolean getOnlyExportedKeys()
returns whether only exported keys are returned


setOnlyImportedKeys

public void setOnlyImportedKeys(boolean value)
sets whether to retrieve only imported keys


getOnlyImportedKeys

public boolean getOnlyImportedKeys()
returns whether only imported keys are returned


setExcludes

public void setExcludes(java.util.Vector excludes)
sets the fields (String) to exclude from export


setExcludes

public void setExcludes(java.lang.String excludes)
sets the fields (String) to exclude from export


getList

public java.util.Vector getList()
retrieves the list of column names and returns them in a Vector

Specified by:
getList in interface Lister

getColumnNamesForImportedKey

public java.util.Vector getColumnNamesForImportedKey(java.lang.String colName)
determines the name(s) of the column in the current table which resembles the given imported (i.e. foreign key) column

Parameters:
colName - the column to retrieve the name(s) in the current table for
Returns:
the name(s) of the foreign key in this table

toString

public java.lang.String toString()
returns the current setting in a string representation

Overrides:
toString in class ProperObject