|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.gui.GenericPropertiesCreator
public class GenericPropertiesCreator
This class can generate the properties object that is normally loaded from
the GenericObjectEditor.props
file (= PROPERTY_FILE). It takes
the GenericPropertiesCreator.props
file as a template to
determine all the derived classes by checking the classes in the given
packages (a file with the same name in your home directory overrides the
the one in the weka/gui directory/package).
E.g. if we want to have all the subclasses of the Classifier
class then we specify the superclass ("weka.classifiers.Classifier") and the
packages where to look for ("weka.classifiers.bayes" etc.):
weka.classifiers.Classifier=\ weka.classifiers.bayes,\ weka.classifiers.functions,\ weka.classifiers.lazy,\ weka.classifiers.meta,\ weka.classifiers.trees,\ weka.classifiers.rulesThis creates the same list as stored in the
GenericObjectEditor.props
file, but it will also add
additional classes, that are not listed in the static list (e.g. a newly
developed Classifier), but still in the classpath.
CREATOR_FILE
,
PROPERTY_FILE
,
GenericObjectEditor
,
RTSI
Field Summary | |
---|---|
static boolean |
VERBOSE
whether to output some debug information |
Constructor Summary | |
---|---|
GenericPropertiesCreator()
initializes the creator, locates the props file with the Utils class. |
|
GenericPropertiesCreator(java.lang.String filename)
initializes the creator, the given file overrides the props-file search of the Utils class |
Method Summary | |
---|---|
void |
execute()
generates the props-file for the GenericObjectEditor and stores it |
void |
execute(boolean store)
generates the props-file for the GenericObjectEditor and stores it only if the the param store is TRUE. |
boolean |
getExplicitPropsFile()
returns TRUE, if a file is loaded and not the Utils class used for locating the props file. |
java.lang.String |
getInputFilename()
returns the name of the input file |
java.util.Properties |
getInputProperties()
returns the input properties object (template containing the packages) |
java.lang.String |
getOutputFilename()
returns the name of the output file |
java.util.Properties |
getOutputProperties()
returns the output properties object (structure like the template, but filled with classes instead of packages) |
static void |
main(java.lang.String[] args)
for generating props file: no parameter: see default constructor 1 parameter (i.e., filename): see default constructor + setOutputFilename(String) 2 parameters (i.e, filenames): see constructor with String argument + setOutputFilename(String) |
void |
setExplicitPropsFile(boolean value)
if FALSE, the locating of a props-file of the Utils-class is used, otherwise it's tried to load the specified file |
void |
setInputFilename(java.lang.String filename)
sets the file to get the information about the packages from. |
void |
setOutputFilename(java.lang.String filename)
sets the file to output the properties for the GEO to |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean VERBOSE
Constructor Detail |
---|
public GenericPropertiesCreator() throws java.lang.Exception
java.lang.Exception
- if loading of CREATOR_FILE failsCREATOR_FILE
,
Utils.readProperties(String)
,
loadInputProperties()
public GenericPropertiesCreator(java.lang.String filename) throws java.lang.Exception
filename
- the file containing the packages to create a props file from
java.lang.Exception
- if loading of the file failsCREATOR_FILE
,
Utils.readProperties(String)
,
loadInputProperties()
Method Detail |
---|
public void setExplicitPropsFile(boolean value)
Utils.readProperties(String)
,
loadInputProperties()
public boolean getExplicitPropsFile()
Utils.readProperties(String)
,
loadInputProperties()
public java.lang.String getOutputFilename()
public void setOutputFilename(java.lang.String filename)
filename
- the filename for the outputpublic java.lang.String getInputFilename()
public void setInputFilename(java.lang.String filename)
filename
- the filename for the inputsetExplicitPropsFile(boolean)
public java.util.Properties getInputProperties()
public java.util.Properties getOutputProperties()
public void execute() throws java.lang.Exception
java.lang.Exception
execute(boolean)
public void execute(boolean store) throws java.lang.Exception
store
is TRUE. If it is FALSE then the
generated properties file can be retrieved via the getOutputProperties
method.
store
- if TRUE then the properties file is stored to the stored
filename
java.lang.Exception
getOutputFilename()
,
setOutputFilename(String)
,
getOutputProperties()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
GenericPropertiesCreator()
,
GenericPropertiesCreator(String)
,
setOutputFilename(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |