Class ConverterFactory

    • Constructor Detail

      • ConverterFactory

        public ConverterFactory()
    • Method Detail

      • getConverter

        public static JepConversionFunction<?> getConverter​(Object o)
        Get a converter for the specified built-in JEP object.
        Parameters:
        o - The object to convert
        Returns:
        A JepConversionFunction or null if no converter is found
      • getConverterByClass

        public static JepConversionFunction<?> getConverterByClass​(Object o)
        Get a converter for the specified built-in JEP object by checking if a converter has been registered for it's class.
        Parameters:
        o - The object to convert
        Returns:
        A JepConversionFunction or null if no converter is found
      • registerConverter

        public static void registerConverter​(Object o,
                                             JepConversionFunction<?> converter)
        Add a converter for a specific object. It can for example, be the class of a JEP function, the symbol for an operator:
        registerConverter(Add.class, new AddConverter());
        registerConverter("==", new EqualsConverter());
        
        Parameters:
        o - The object defining what the converter can convert
        converter - The converter
        Throws:
        ItemAlreadyExistsException - If a converter already exists for the given class