Github user robdouglas commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/131#discussion_r20456793
  
    --- Diff: 
streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java
 ---
    @@ -0,0 +1,51 @@
    +package org.apache.streams.converter;
    +
    +import com.fasterxml.jackson.databind.ObjectMapper;
    +import com.fasterxml.jackson.databind.node.ObjectNode;
    +import org.apache.streams.jackson.StreamsJacksonMapper;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.io.IOException;
    +
    +/**
    + * TypeConverterUtil supports TypeConverterProcessor in converting between 
String json and
    + * jackson-compatible POJO objects
    + */
    +public class TypeConverterUtil {
    +
    +    private final static Logger LOGGER = 
LoggerFactory.getLogger(TypeConverterUtil.class);
    +
    +    public static Object convert(Object object, Class outClass) {
    +        return TypeConverterUtil.convert(object, outClass, 
StreamsJacksonMapper.getInstance());
    +    }
    +
    +    public static Object convert(Object object, Class outClass, 
ObjectMapper mapper) {
    +        ObjectNode node = null;
    +        Object outDoc = null;
    +        if( object instanceof String ) {
    +            try {
    +                node = mapper.readValue((String)object, ObjectNode.class);
    --- End diff --
    
    Could you use the mapper to write out the String value?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to