Class SimpleObjectTransformer

    • Constructor Detail

      • SimpleObjectTransformer

        public SimpleObjectTransformer()
    • Method Detail

      • jsonToPojo

        public Object jsonToPojo​(org.codehaus.jackson.JsonNode from,
                                 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:
        from - 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 from,
                                                        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:
        from - The object to transform
        Returns:
        The json representation, never return null. Throw the exception if problems occur.
        Throws:
        de.mhus.lib.errors.NotSupportedException
      • getValue

        public static Object getValue​(org.codehaus.jackson.JsonNode node,
                                      TransformHelper helper)