|
@@ -18,18 +18,17 @@
|
|
|
|
|
|
package org.apache.zookeeper.server.admin;
|
|
package org.apache.zookeeper.server.admin;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
|
-import java.io.PrintWriter;
|
|
|
|
-import java.util.Map;
|
|
|
|
-
|
|
|
|
-import org.codehaus.jackson.JsonGenerationException;
|
|
|
|
-import org.codehaus.jackson.map.JsonMappingException;
|
|
|
|
-import org.codehaus.jackson.map.ObjectMapper;
|
|
|
|
-import org.codehaus.jackson.map.PropertyNamingStrategy;
|
|
|
|
-import org.codehaus.jackson.map.SerializationConfig;
|
|
|
|
|
|
+import com.fasterxml.jackson.core.JsonGenerationException;
|
|
|
|
+import com.fasterxml.jackson.databind.JsonMappingException;
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
|
|
|
+import com.fasterxml.jackson.databind.SerializationFeature;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.PrintWriter;
|
|
|
|
+
|
|
public class JsonOutputter implements CommandOutputter {
|
|
public class JsonOutputter implements CommandOutputter {
|
|
static final Logger LOG = LoggerFactory.getLogger(JsonOutputter.class);
|
|
static final Logger LOG = LoggerFactory.getLogger(JsonOutputter.class);
|
|
|
|
|
|
@@ -39,9 +38,9 @@ public class JsonOutputter implements CommandOutputter {
|
|
|
|
|
|
public JsonOutputter() {
|
|
public JsonOutputter() {
|
|
mapper = new ObjectMapper();
|
|
mapper = new ObjectMapper();
|
|
- mapper.configure(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING, true);
|
|
|
|
- mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
|
|
|
|
- mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
|
|
|
|
|
|
+ mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true);
|
|
|
|
+ mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
|
|
|
|
+ mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|