Class JacksonHelper

java.lang.Object
org.apache.groovy.xml.util.JacksonHelper

public class JacksonHelper extends Object
Internal helper for optional Jackson databinding support. Uses reflection to avoid a compile-time dependency on jackson-databind.
  • Constructor Details

    • JacksonHelper

      public JacksonHelper()
  • Method Details

    • convertMapToType

      public static <T> T convertMapToType(Map<String,Object> map, Class<T> type)
      Converts a Map to a typed object using Jackson's ObjectMapper.convertValue. Requires jackson-databind on the classpath.
      Type Parameters:
      T - the target type
      Parameters:
      map - the source map
      type - the target type
      Returns:
      the converted object
      Throws:
      XmlRuntimeException - if jackson-databind is not available or conversion fails