Class JavaTypeConverter

  • public class JavaTypeConverter
    extends Object
    Generic universal type converter. It is supposed to covert anything to anything as long as there is any way to convert it. This means converting string containing a decimal representation of a number to int, PolyString to string, etc. This is supposed to work in a fashion similar to many scripting languages (e.g. perl) where the programmer does not really care about the type and the type conversion is done automatically.

    TODO clean this up as it is now part of prism-api!

    Radovan Semancik
    • Constructor Detail

      • JavaTypeConverter

        public JavaTypeConverter()
    • Method Detail

      • convert

        public static <T> T convert​(Class<T> expectedType,
                                    Object rawValue)
      • convert

        public static Object convert​(Class<?> expectedType,
                                     Object rawValue,
                                     boolean failIfImpossible)
      • isTypeCompliant

        public static <T> boolean isTypeCompliant​(@Nullable
                                                  T value,
                                                  @Nullable Class<?> expectedClass)