|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.util.tokenizer.TokenizerSettings
org.knime.base.node.io.filereader.FileReaderSettings
org.knime.base.node.io.filereader.FileReaderNodeSettings
public class FileReaderNodeSettings
Field Summary |
---|
Fields inherited from class org.knime.base.node.io.filereader.FileReaderSettings |
---|
CFGKEY_DATAURL, DEF_ROWPREFIX |
Constructor Summary | |
---|---|
FileReaderNodeSettings()
Creates an empty settings object. |
|
FileReaderNodeSettings(FileReaderNodeSettings clonee)
Creates a new settings object with the exact same settings as the object passed in. |
|
FileReaderNodeSettings(NodeSettingsRO cfg)
Creates a new settings object for the file reader note and initializes it from the config object passed. |
Method Summary | |
---|---|
protected void |
addStatusOfSettings(SettingsStatus status,
boolean openDataFile,
DataTableSpec tableSpec)
Call this from derived classes to add the status of all super classes. |
(package private) boolean |
analyzeUsedAllRows()
|
DataTableSpec |
createDataTableSpec()
Derives a DataTableSpec from the current settings. |
boolean |
decimalSeparatorUserSet()
Tells whether the decimal separator is set by the user or guessed by the analyzer (or still at its default). |
Vector<ColProperty> |
getColumnProperties()
|
String |
getMissingValueOfColumn(int colIdx)
Overriding super method because we store these missing values now in the column properties. |
int |
getNumberOfColumns()
|
(package private) boolean |
getPreserveSettings()
Checks the flag that indicates if settings will be reset at location change. |
boolean[] |
getSkippedColumns()
|
SettingsStatus |
getStatusOfSettings()
Method to check consistency and completeness of the current settings. |
SettingsStatus |
getStatusOfSettings(boolean openDataFile,
DataTableSpec tableSpec)
Method to check consistency and completeness of the current settings. |
boolean |
ignoreDelimsAtEORUserSet()
|
boolean |
ignoreDelimsAtEORUserValue()
|
boolean |
isCommentUserSet()
|
boolean |
isDelimiterUserSet()
|
boolean |
isFileHasColumnHeadersUserSet()
|
boolean |
isFileHasRowHeadersUserSet()
|
boolean |
isIgnoreEmptyLinesUserSet()
|
boolean |
isQuoteUserSet()
|
boolean |
isWhiteSpaceUserSet()
|
static FileReaderNodeSettings |
readSettingsFromXMLFile(String xmlLocation)
Reads the FileReaderNodeSettings from the specified XML file and returns a new settings object. |
void |
saveToConfiguration(NodeSettingsWO cfg)
Writes all settings into the passed configuration object. |
(package private) void |
setAnalyzeUsedAllRows(boolean val)
Sets the value of the flag which is used to indicate if the FileAnalyzer looked at all rows when it extracts the default
settings. |
void |
setColumnProperties(Vector<? extends ColProperty> colProps)
Stores a copy of the vector of properties in the structure. |
void |
setCommentUserSet(boolean s)
Set true to indicate that the flag is actually set and is
not still the default value. |
void |
setDecimalSeparatorUserSet(boolean value)
Sets a new value to the flag that indicates that the decimal value is explictly set by the user. |
void |
setDelimiterUserSet(boolean s)
Set true to indicate that the flag is actually set and is
not still the default value. |
void |
setFileHasColumnHeadersUserSet(boolean s)
Set true to indicate that the flag is actually set and is
not still the default value. |
void |
setFileHasRowHeadersUserSet(boolean s)
Set true to indicate that the flag is actually set and is
not still the default value. |
void |
setIgnoreDelimsAtEndOfRowUserValue(boolean ignoreEm)
Sets the "is user set" flag and stores the user value. |
void |
setIgnoreEmptyLinesUserSet(boolean s)
Set true to indicate that the flag is actually set and is not still the default value. |
void |
setMissingValueForColumn(int colIdx,
String pattern)
Overriding super method because we store these missing values now in the column properties. |
void |
setNumberOfColumns(int numOfCols)
Stores the number of columns set by the user. |
(package private) void |
setPreserveSettings(boolean preserveSettings)
Sets the flag that determines if settings are reset if a new data location is entered in the dialog. |
void |
setQuoteUserSet(boolean s)
Set true to indicate that the flag is actually set and is
not still the default value. |
void |
setWhiteSpaceUserSet(boolean s)
Set true to indicate that the flag is actually set and is
not still the default value. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
FileReaderNodeSettings(NodeSettingsRO cfg) throws InvalidSettingsException
null
is passed default
settings will be applied where applicable. The default setting are not
valid in the sense that they can't be used without modification.
cfg
- a config object containing all settings or null
to create default settings
InvalidSettingsException
- if the settings in the config object are
incomplete, inconsistent or in any other was invalidFileReaderNodeSettings(FileReaderNodeSettings clonee)
clonee
- the settings object to copy the settings values from.public FileReaderNodeSettings()
Method Detail |
---|
public void saveToConfiguration(NodeSettingsWO cfg)
NodeSettingsWO
object. Using the cfg object to construct a new FileReaderSettings object
should lead to an object identical to this.
saveToConfiguration
in class FileReaderSettings
cfg
- the config object the settings are stored intopublic void setColumnProperties(Vector<? extends ColProperty> colProps)
colProps
- the column properties to storepublic Vector<ColProperty> getColumnProperties()
ColProperty
objects or
null
if not setpublic String getMissingValueOfColumn(int colIdx)
getMissingValueOfColumn
in class FileReaderSettings
colIdx
- the index of the column the missing value is asked for
null
if no
patern is set for that column.public void setMissingValueForColumn(int colIdx, String pattern)
setMissingValueForColumn
in class FileReaderSettings
colIdx
- the index of the column this missing value is set forpattern
- the pattern specifying the missing value in the data file
for the specified column. Can be null
to delete
a previously set pattern.public void setNumberOfColumns(int numOfCols)
numOfCols
- the number of columns to storepublic int getNumberOfColumns()
public DataTableSpec createDataTableSpec()
null
if the current settings are invalidpublic boolean[] getSkippedColumns()
public static FileReaderNodeSettings readSettingsFromXMLFile(String xmlLocation)
xmlLocation
- location of the xml file to read. Must be a valid URL.
IllegalStateException
- if something goes wrongpublic void setIgnoreEmptyLinesUserSet(boolean s)
s
- the new value of the flagpublic boolean isIgnoreEmptyLinesUserSet()
true
if the value was set by the user,
false
if it's still at constructor's default valuepublic void setFileHasRowHeadersUserSet(boolean s)
true
to indicate that the flag is actually set and is
not still the default value.
s
- the new value of the flagpublic boolean isFileHasRowHeadersUserSet()
true
is the value was set, false
if
it's still at constructor's default valuepublic void setFileHasColumnHeadersUserSet(boolean s)
true
to indicate that the flag is actually set and is
not still the default value.
s
- the new value of the flagpublic boolean isFileHasColumnHeadersUserSet()
true
is the value was set, false
if
it's still at constructor's default valuepublic void setCommentUserSet(boolean s)
true
to indicate that the flag is actually set and is
not still the default value.
s
- the new value of the flagpublic boolean isCommentUserSet()
true
is the value was set by the user,
false
if it's still at constructor's default valuepublic void setDelimiterUserSet(boolean s)
true
to indicate that the flag is actually set and is
not still the default value.
s
- the new value of the flagpublic boolean isDelimiterUserSet()
true
is the value was set by the user,
false
if it's still at constructor's default valuepublic void setQuoteUserSet(boolean s)
true
to indicate that the flag is actually set and is
not still the default value.
s
- the new value of the flagpublic boolean isQuoteUserSet()
true
is the value was set by the user,
false
if it's still at constructor's default valuepublic void setWhiteSpaceUserSet(boolean s)
true
to indicate that the flag is actually set and is
not still the default value.
s
- the new value of the flagpublic boolean isWhiteSpaceUserSet()
true
is the value was set by the user,
false
if it's still at constructor's default valuepublic void setIgnoreDelimsAtEndOfRowUserValue(boolean ignoreEm)
ignoreEm
- if true
extra delims at the end of the row
(in case of a tab or space delim) will be ignored.public boolean ignoreDelimsAtEORUserSet()
true
, if user set the value for "ignore delims at
end of row"public boolean decimalSeparatorUserSet()
public void setDecimalSeparatorUserSet(boolean value)
value
- the new value of the flag.public boolean ignoreDelimsAtEORUserValue()
boolean analyzeUsedAllRows()
false
by default.void setAnalyzeUsedAllRows(boolean val)
FileAnalyzer
looked at all rows when it extracts the default
settings. The value of the flag is not stored when the settings are saved
into a config, and is not recovered from a config object.
val
- the new value of the flagpublic SettingsStatus getStatusOfSettings()
SettingsStatus
object which contains info,
warning and error messages, if something is fishy with the settings.
getStatusOfSettings
in class FileReaderSettings
public SettingsStatus getStatusOfSettings(boolean openDataFile, DataTableSpec tableSpec)
SettingsStatus
object which contains info, warning
and error messages, if something is fishy with the settings.
Method to check consistency and completeness of the current settings. It
will return a SettingsStatus
object which contains info, warning
and error messages. Or if the settings are alright it will return null.
getStatusOfSettings
in class FileReaderSettings
openDataFile
- tells whether or not this method should try to access
the data file. This will - if set true
- verify
the accessibility of the data.tableSpec
- the spec of the DataTable these settings are for. If set
null
only a few checks will be performed - the
ones that are possible without the knowledge of the structure
of the table
null
if no messages were generated
(i.e. all settings are just fine).protected void addStatusOfSettings(SettingsStatus status, boolean openDataFile, DataTableSpec tableSpec)
addStatusOfSettings
in class FileReaderSettings
status
- the object to add messages to - if anyopenDataFile
- specifies if we should check the accessability of the
data filetableSpec
- the spec of the DataTable these settings are for. If set
null
only a few checks will be performed - the
ones that are possible without the knowledge of the structure
of the tablepublic String toString()
toString
in class FileReaderSettings
boolean getPreserveSettings()
void setPreserveSettings(boolean preserveSettings)
preserveSettings
- set true to reset all dialog settings if the data
location changes, or false to preserve the current settings.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |