Class 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 Detail

      • 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_Mapping

        protected HashMap<String,​String> m_Mapping
        the mapping (exact classname replacement).
      • m_MappingPartialOrder

        protected List<String> m_MappingPartialOrder
        the partial mapping order.
      • m_MappingPartial

        protected HashMap<String,​String> m_MappingPartial
        the mapping (partial renaming).
      • m_Singleton

        protected static Conversion m_Singleton
        the singleton.
    • Constructor Detail

      • Conversion

        protected Conversion()
        Initializes the conversions.
    • 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 process
        option - 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 process
        property - the property to process
        Returns:
        the potentially updated option
      • getSingleton

        public static Conversion getSingleton()
        Returns the singleton.
        Returns:
        the singleton