Package org.kie.dmn.feel.marshaller
Class FEELCodeMarshaller
- java.lang.Object
-
- org.kie.dmn.feel.marshaller.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
-
-
Field Summary
Fields Modifier and Type Field Description static FEELCodeMarshallerINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringmarshall(java.lang.Object value)Marshalls the given value into FEEL code that can be executed to reconstruct the value.java.lang.Objectunmarshall(Type feelType, java.lang.String value)Unmarshalls the string into a FEEL value by executing it.
-
-
-
Field Detail
-
INSTANCE
public static final FEELCodeMarshaller INSTANCE
-
-
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:
marshallin interfaceFEELMarshaller<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:
unmarshallin interfaceFEELMarshaller<java.lang.String>- Parameters:
feelType- this parameter is ignored by this marshaller and can be set to nullvalue- the FEEL code to execute for unmarshalling- Returns:
- the value resulting from executing the code
-
-