public class GenericPropertiesCreator extends Object
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). 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. UseDyanmic
property in the props file (values: true|false).CREATOR_FILE
,
PROPERTY_FILE
,
USE_DYNAMIC
,
GenericObjectEditor
,
ClassDiscovery
Modifier and Type | Field and Description |
---|---|
static String |
USE_DYNAMIC
name of property whether to use the dynamic approach or the old
GenericObjectEditor.props file
|
static boolean |
VERBOSE
whether to output some debug information
|
Constructor and Description |
---|
GenericPropertiesCreator()
initializes the creator, locates the props file with the Utils class.
|
GenericPropertiesCreator(String filename)
initializes the creator, the given file overrides the props-file search
of the Utils class
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
generates the props-file for the GenericObjectEditor and stores it
|
void |
execute(boolean store)
generates the props-file for the GenericObjectEditor
|
void |
execute(boolean store,
boolean loadInputProps)
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.
|
static Properties |
getGlobalInputProperties()
Get the global input properties
|
static Properties |
getGlobalOutputProperties()
Get the global output properties
|
String |
getInputFilename()
returns the name of the input file
|
Properties |
getInputProperties()
returns the input properties object (template containing the packages)
|
String |
getOutputFilename()
returns the name of the output file
|
Properties |
getOutputProperties()
returns the output properties object (structure like the template, but
filled with classes instead of packages)
|
static void |
main(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)
|
static void |
regenerateGlobalOutputProperties()
Regenerate the global output properties.
|
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(String filename)
sets the file to get the information about the packages from.
|
void |
setOutputFilename(String filename)
sets the file to output the properties for the GEO to
|
boolean |
useDynamic()
gets whether the dynamic approach should be used or not
|
public static final boolean VERBOSE
public static final String USE_DYNAMIC
public GenericPropertiesCreator() throws Exception
Exception
- if loading of CREATOR_FILE failsCREATOR_FILE
,
Utils.readProperties(String)
,
loadInputProperties()
public GenericPropertiesCreator(String filename) throws Exception
filename
- the file containing the packages to create a props file fromException
- if loading of the file failsCREATOR_FILE
,
Utils.readProperties(String)
,
loadInputProperties()
public static Properties getGlobalOutputProperties()
public static Properties getGlobalInputProperties()
public static void regenerateGlobalOutputProperties()
public void setExplicitPropsFile(boolean value)
value
- if true the specified file will be loaded not via the
Utils-classUtils.readProperties(String)
,
loadInputProperties()
public boolean getExplicitPropsFile()
Utils.readProperties(String)
,
loadInputProperties()
public String getOutputFilename()
public void setOutputFilename(String filename)
filename
- the filename for the outputpublic String getInputFilename()
public void setInputFilename(String filename)
filename
- the filename for the inputsetExplicitPropsFile(boolean)
public Properties getInputProperties()
public Properties getOutputProperties()
public boolean useDynamic()
public void execute() throws Exception
Exception
- if something goes wrongexecute(boolean)
public void execute(boolean store) throws Exception
store
- true if the generated props should be storedException
public void execute(boolean store, boolean loadInputProps) throws 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
filenameloadInputProps
- true if the input properties should be loadedException
- if something goes wronggetOutputFilename()
,
setOutputFilename(String)
,
getOutputProperties()
public static void main(String[] args) throws Exception
args
- the commandline argumentsException
- if something goes wrongGenericPropertiesCreator()
,
GenericPropertiesCreator(String)
,
setOutputFilename(String)
Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.