本文整理汇总了Java中com.alibaba.dubbo.common.json.Jackson类的典型用法代码示例。如果您正苦于以下问题:Java Jackson类的具体用法?Java Jackson怎么用?Java Jackson使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Jackson类属于com.alibaba.dubbo.common.json包,在下文中一共展示了Jackson类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JacksonObjectInput
import com.alibaba.dubbo.common.json.Jackson; //导入依赖的package包/类
public JacksonObjectInput(InputStream inputstream) throws IOException {
// this.reader = new BufferedReader(new InputStreamReader(inputstream));
// String line = null;
// try {
// while ((line = reader.readLine()) != null) {
// System.out.println(line);
// }
// }catch(Exception e){
// e.printStackTrace();
// }
this.objectMapper = Jackson.getObjectMapper();
try {
data = objectMapper.readValue(inputstream, Map.class);
} catch (IOException e) {
logger.error("parse inputstream error.", e);
throw e;
}
}
示例2: JacksonObjectInput
import com.alibaba.dubbo.common.json.Jackson; //导入依赖的package包/类
public JacksonObjectInput(InputStream inputstream) throws IOException {
// this.reader = new BufferedReader(new InputStreamReader(inputstream));
// String line = null;
// try {
// while ((line = reader.readLine()) != null) {
// System.out.println(line);
// }
// }catch(Exception e){
// e.printStackTrace();
// }
this.objectMapper = Jackson.getObjectMapper();
try {
data = objectMapper.readValue(inputstream, Map.class);
} catch (IOException e) {
log.error("parse inputstream error.", e);
throw e;
}
}
示例3: JacksonObjectOutput
import com.alibaba.dubbo.common.json.Jackson; //导入依赖的package包/类
public JacksonObjectOutput(Writer writer) {
this.objectMapper = Jackson.getObjectMapper();
this.writer = new PrintWriter(writer);
this.data = new HashMap<String, Object>();
}