Package adams.core.option
Class Conversion
- java.lang.Object
-
- adams.core.option.Conversion
-
public class Conversion extends Object
Helper class that converts classnames from options on the fly into the most up-to-date format.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String
FILENAME
the name of the props file.static String
KEY_PARTIAL_RENAME
the key that lists the partial renaming keys.static String
KEY_RENAME
the key that lists the classname mapping keys.static String
KEY_RENAME_OPTION
the key that lists the keys for option renaming.static String
KEY_RENAME_PROPERTY
the key that lists the keys for property renaming.protected HashMap<String,String>
m_Mapping
the mapping (exact classname replacement).protected HashMap<String,HashMap<String,String>>
m_MappingOption
the mapping (option renaming: class - [-old, -new]).protected HashMap<String,String>
m_MappingPartial
the mapping (partial renaming).protected List<String>
m_MappingPartialOrder
the partial mapping order.protected HashMap<String,HashMap<String,String>>
m_MappingProperty
the mapping (property renaming: class - [oldProp, newProp]).protected Properties
m_Properties
the properties.protected static Conversion
m_Singleton
the singleton.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Conversion()
Initializes the conversions.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Properties
getProperties()
Returns the properties that define the editor.static Conversion
getSingleton()
Returns the singleton.protected void
initMappings()
Initializes the mapping.String
rename(String classname)
Renames a classname if necessary.String
renameOption(String classname, String option)
Renames an option (eg -blah to -bloerk) if necessary.String
renameProperty(String classname, String property)
Renames a property (eg blahProp to bloerkProp) if necessary.
-
-
-
Field Detail
-
FILENAME
public static final String FILENAME
the name of the props file.- See Also:
- Constant Field Values
-
KEY_RENAME
public static final String KEY_RENAME
the key that lists the classname mapping keys.- See Also:
- Constant Field Values
-
KEY_PARTIAL_RENAME
public static final String KEY_PARTIAL_RENAME
the key that lists the partial renaming keys.- See Also:
- Constant Field Values
-
KEY_RENAME_OPTION
public static final String KEY_RENAME_OPTION
the key that lists the keys for option renaming.- See Also:
- Constant Field Values
-
KEY_RENAME_PROPERTY
public static final String KEY_RENAME_PROPERTY
the key that lists the keys for property renaming.- See Also:
- Constant Field Values
-
m_Properties
protected Properties m_Properties
the properties.
-
m_MappingOption
protected HashMap<String,HashMap<String,String>> m_MappingOption
the mapping (option renaming: class - [-old, -new]).
-
m_MappingProperty
protected HashMap<String,HashMap<String,String>> m_MappingProperty
the mapping (property renaming: class - [oldProp, newProp]).
-
m_Singleton
protected static Conversion m_Singleton
the singleton.
-
-
Method Detail
-
getProperties
protected Properties getProperties()
Returns the properties that define the editor.- Returns:
- the properties
-
initMappings
protected void initMappings()
Initializes the mapping.
-
rename
public String rename(String classname)
Renames a classname if necessary.- Parameters:
classname
- the classname to process- Returns:
- the potentially updated classname
-
renameOption
public String renameOption(String classname, String option)
Renames an option (eg -blah to -bloerk) if necessary.- Parameters:
classname
- the classname to processoption
- the option to process (with or without leading dash)- Returns:
- the potentially updated option
-
renameProperty
public String renameProperty(String classname, String property)
Renames a property (eg blahProp to bloerkProp) if necessary.- Parameters:
classname
- the classname to processproperty
- the property to process- Returns:
- the potentially updated option
-
getSingleton
public static Conversion getSingleton()
Returns the singleton.- Returns:
- the singleton
-
-