Class FEELCodeMarshaller

  • All Implemented Interfaces:
    FEELMarshaller<java.lang.String>

    public class FEELCodeMarshaller
    extends java.lang.Object
    implements FEELMarshaller<java.lang.String>
    An implementation of the FEEL marshaller interface that converts FEEL objects into it's string representation and vice versa
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String marshall​(java.lang.Object value)
      Marshalls the given value into FEEL code that can be executed to reconstruct the value.
      java.lang.Object unmarshall​(Type feelType, java.lang.String value)
      Unmarshalls the string into a FEEL value by executing it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • marshall

        public java.lang.String marshall​(java.lang.Object value)
        Marshalls the given value into FEEL code that can be executed to reconstruct the value. For instance, here are some examples of the marshalling process: * number 10 marshalls as: 10 * string foo marshalls as: "foo" * duration P1D marshalls as: duration( "P1D" ) * context { x : 10, y : foo } marshalls as: { x : 10, y : "foo" }
        Specified by:
        marshall in interface FEELMarshaller<java.lang.String>
        Parameters:
        value - the FEEL value to be marshalled
        Returns:
        a string representing the FEEL code that needs to be executed to reconstruct the value
      • unmarshall

        public java.lang.Object unmarshall​(Type feelType,
                                           java.lang.String value)
        Unmarshalls the string into a FEEL value by executing it.
        Specified by:
        unmarshall in interface FEELMarshaller<java.lang.String>
        Parameters:
        feelType - this parameter is ignored by this marshaller and can be set to null
        value - the FEEL code to execute for unmarshalling
        Returns:
        the value resulting from executing the code