Class JacksonTransformer

    • Constructor Detail

      • JacksonTransformer

        public JacksonTransformer()
    • Method Detail

      • jsonToPojo

        public Object jsonToPojo​(org.codehaus.jackson.JsonNode node,
                                 Class<?> type,
                                 TransformHelper helper)
                          throws de.mhus.lib.errors.NotSupportedException
        Description copied from class: TransformStrategy
        Transform the json into an object, some implementations need a type hint to create the object.
        Specified by:
        jsonToPojo in class TransformStrategy
        Parameters:
        node - The object data
        type - The type hint, can also be null. If this is not supportet throw the exception
        helper - The helper to create objects
        Returns:
        The object, can also be null if the object originally was null.
        Throws:
        de.mhus.lib.errors.NotSupportedException - Thrown if the object could not be created.
      • pojoToJson

        public org.codehaus.jackson.JsonNode pojoToJson​(Object obj,
                                                        TransformHelper helper)
                                                 throws de.mhus.lib.errors.NotSupportedException
        Description copied from class: TransformStrategy
        Transform an object into an json representation.
        Specified by:
        pojoToJson in class TransformStrategy
        Parameters:
        obj - The object to transform
        Returns:
        The json representation, never return null. Throw the exception if problems occur.
        Throws:
        de.mhus.lib.errors.NotSupportedException