Class PropertyHelper


  • public class PropertyHelper
    extends Object
    Helper class for updating properties of objects.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • PropertyHelper

        public PropertyHelper()
    • Method Detail

      • initialize

        protected static void initialize()
        Initializes the converter list.
        See Also:
        m_Converters
      • convertValue

        protected static Object convertValue​(Class cls,
                                             String value,
                                             MessageCollection errors)
        Converts the string value into an object.
        Parameters:
        cls - the requested class
        value - the string representation
        errors - for collecting errors
        Returns:
        the object or null if failed to convert
      • convertValue

        public static Object convertValue​(PropertyPath.PropertyContainer cont,
                                          String value,
                                          MessageCollection errors)
        Converts the value into the appropriate object, if possible.
        Parameters:
        cont - the property container to use
        value - the string to convert
        Returns:
        the converted value or null if it cannot be converted