|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.plugin.FarragoAbstractPluginBase net.sf.farrago.namespace.impl.MedAbstractBase net.sf.farrago.namespace.flatfile.FlatFileParams
class FlatFileParams
Decodes options used for a flat file data server. An instance of this class
must be initialized with decode()
before calling its other
methods. The conventions for parameters are as follows:
Nested Class Summary | |
---|---|
static class |
FlatFileParams.SchemaType
Enumeration for schema types used by the flat file reader. |
Fields inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase |
---|
BOOLEAN_CHOICES_DEFAULT_FALSE, BOOLEAN_CHOICES_DEFAULT_TRUE, EMPTY_DRIVER_PROPERTIES |
Constructor Summary | |
---|---|
FlatFileParams(Properties props)
Constructs an uninitialized FlatFileParams. |
Method Summary | |
---|---|
void |
decode()
The main entry point into paremter decoding. |
private String |
decodeDatetimeFormat(String format)
|
private char |
decodeDelimiter(String delim)
Decodes a delimiter string into a canonical delimiter character. |
private String |
decodeDirectory(String directory)
Decodes a directory name into a useful format. |
private String |
decodeExtension(String extension)
|
private char |
decodeSpecialChar(String specialChar,
String defaultChar)
Decodes a quote or escape character. |
String |
getControlFileExtenstion()
|
String |
getDateFormat()
|
String |
getDirectory()
|
char |
getEscapeChar()
|
char |
getFieldDelimiter()
|
String |
getFileExtenstion()
|
boolean |
getLenient()
|
char |
getLineDelimiter()
|
String |
getLogDirectory()
|
boolean |
getMapped()
|
int |
getNumRowsScan()
|
char |
getQuoteChar()
|
static FlatFileParams.SchemaType |
getSchemaType(String schemaName,
boolean queryDefault)
Lookup the type of a schema based upon it's schema name. |
String |
getTimeFormat()
|
String |
getTimestampFormat()
|
boolean |
getTrim()
|
boolean |
getWithHeader()
|
boolean |
getWithLogging()
|
Methods inherited from class net.sf.farrago.plugin.FarragoAbstractPluginBase |
---|
getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getShortProperty, requireProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_DIRECTORY
public static final String PROP_FILE_EXTENSION
public static final String PROP_CONTROL_FILE_EXTENSION
public static final String PROP_FIELD_DELIMITER
public static final String PROP_LINE_DELIMITER
public static final String PROP_QUOTE_CHAR
public static final String PROP_ESCAPE_CHAR
public static final String PROP_WITH_HEADER
public static final String PROP_NUM_ROWS_SCAN
public static final String PROP_WITH_LOGGING
public static final String PROP_LOG_DIRECTORY
public static final String PROP_DATE_FORMAT
public static final String PROP_TIME_FORMAT
public static final String PROP_TIMESTAMP_FORMAT
public static final String PROP_LENIENT
public static final String PROP_TRIM
public static final String PROP_MAPPED
public static final String FILE_EXTENSION_PREFIX
public static final String LOG_FILE_EXTENSION
protected static final String DEFAULT_FILE_EXTENSION
protected static final String DEFAULT_CONTROL_FILE_EXTENSION
protected static final String DEFAULT_FIELD_DELIMITER
protected static final String DEFAULT_LINE_DELIMITER
protected static final String DEFAULT_QUOTE_CHAR
protected static final String DEFAULT_ESCAPE_CHAR
protected static final boolean DEFAULT_WITH_HEADER
protected static final int DEFAULT_NUM_ROWS_SCAN
protected static final boolean DEFAULT_WITH_LOGGING
protected static final boolean DEFAULT_LENIENT
protected static final boolean DEFAULT_TRIM
protected static final boolean DEFAULT_MAPPED
private Properties props
private String directory
private String logDirectory
private String fileExtension
private String controlFileExtension
private char fieldDelimiter
private char lineDelimiter
private char quoteChar
private char escapeChar
private boolean withHeader
private boolean withLogging
private int numRowsScan
private boolean lenient
private boolean trim
private boolean mapped
private String dateFormat
private String timeFormat
private String timestampFormat
Constructor Detail |
---|
public FlatFileParams(Properties props)
decode()
must be called before the object is used.
props
- foreign server parametersMethod Detail |
---|
public void decode() throws SQLException
SQLException
private char decodeDelimiter(String delim)
This function comes from legacy code and is based on odd heuristics.
REVIEW: this behavior seems overly complex and awkward
delim
- delimiter string
private char decodeSpecialChar(String specialChar, String defaultChar)
specialChar
- string containing special character, may be emptydefaultChar
- default string, must not be empty
private String decodeDirectory(String directory)
directory
- directory name, may be null
private String decodeExtension(String extension)
private String decodeDatetimeFormat(String format)
public String getDirectory()
public String getFileExtenstion()
public String getControlFileExtenstion()
public char getFieldDelimiter()
public char getLineDelimiter()
public char getQuoteChar()
public char getEscapeChar()
public boolean getWithHeader()
public int getNumRowsScan()
public boolean getWithLogging()
public String getLogDirectory()
public String getDateFormat()
public String getTimeFormat()
public String getTimestampFormat()
public boolean getLenient()
public boolean getTrim()
public boolean getMapped()
public static FlatFileParams.SchemaType getSchemaType(String schemaName, boolean queryDefault)
schemaName
- name of schema to lookupqueryDefault
- whether to make a query the default type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |