/** * Creates an instance of {@link ObjectGenerator} which converts specified instance of {@link ObjectGenerator} to * JSON. Uses default instance of {@link ObjectMapper} to converted to JSON. * * @param generator Instance of {@link ObjectGenerator} which value will be converted to JSON. * @return An instance of {@link ObjectGenerator} which converts specified instance of {@link ObjectGenerator} to * JSON. */ public static ObjectGenerator<String> json(ObjectGenerator<?> generator) { return wrap(new JsonTransformer(generator.value)); }
/** * Creates an instance of {@link ObjectGenerator} which converts specified instance of {@link ObjectGenerator} to * JSON. Uses default instance of {@link ObjectMapper} to converted to JSON. * * @param generator Instance of {@link ObjectGenerator} which value will be converted to JSON. * @return An instance of {@link ObjectGenerator} which converts specified instance of {@link ObjectGenerator} to * JSON. */ public static ObjectGenerator<String> json(ObjectGenerator<?> generator) { return wrap(new JsonTransformer(generator.value)); }
/** * Creates an instance of {@link ObjectGenerator} which converts specified instance of {@link ObjectGenerator} to * JSON. * * @param generator Instance of {@link ObjectGenerator} which value will be converted to JSON. * @param objectMapper Object mapper to use when converting value to JSON. * @return An instance of {@link ObjectGenerator} which converts specified instance of {@link ObjectGenerator} to * JSON. */ public static ObjectGenerator<String> json(ObjectGenerator<?> generator, ObjectMapper objectMapper) { return wrap(new JsonTransformer(generator.value, objectMapper)); }
/** * Creates an instance of {@link ObjectGenerator} which converts specified instance of {@link ObjectGenerator} to * JSON. * * @param generator Instance of {@link ObjectGenerator} which value will be converted to JSON. * @param objectMapper Object mapper to use when converting value to JSON. * @return An instance of {@link ObjectGenerator} which converts specified instance of {@link ObjectGenerator} to * JSON. */ public static ObjectGenerator<String> json(ObjectGenerator<?> generator, ObjectMapper objectMapper) { return wrap(new JsonTransformer(generator.value, objectMapper)); }
/** * JSON transformer definition. * * @return JSON transformer definition rule. */ public Rule jsonTransformer() { return Sequence(function("json", valueReference()), push(new JsonTransformer((Value<?>) pop()))); }
/** * JSON transformer definition. * * @return JSON transformer definition rule. */ public Rule jsonTransformer() { return Sequence(function("json", valueReference()), push(new JsonTransformer((Value<?>) pop()))); }