Class TransformStrategy

    • Constructor Detail

      • TransformStrategy

        public TransformStrategy()
    • Method Detail

      • jsonToPojo

        public Object jsonToPojo​(org.codehaus.jackson.JsonNode node)
                          throws de.mhus.lib.errors.NotSupportedException
        Throws:
        de.mhus.lib.errors.NotSupportedException
      • jsonToPojo

        public Object jsonToPojo​(org.codehaus.jackson.JsonNode node,
                                 Class<?> type)
                          throws de.mhus.lib.errors.NotSupportedException
        Throws:
        de.mhus.lib.errors.NotSupportedException
      • jsonToPojo

        public abstract Object jsonToPojo​(org.codehaus.jackson.JsonNode node,
                                          Class<?> type,
                                          TransformHelper helper)
                                   throws de.mhus.lib.errors.NotSupportedException
        Transform the json into an object, some implementations need a type hint to create the object.
        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)
                                                 throws de.mhus.lib.errors.NotSupportedException
        Throws:
        de.mhus.lib.errors.NotSupportedException
      • pojoToJson

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