当前位置: 首页>>代码示例>>Java>>正文


Java DefaultSerializerProvider类代码示例

本文整理汇总了Java中com.fasterxml.jackson.databind.ser.DefaultSerializerProvider的典型用法代码示例。如果您正苦于以下问题:Java DefaultSerializerProvider类的具体用法?Java DefaultSerializerProvider怎么用?Java DefaultSerializerProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DefaultSerializerProvider类属于com.fasterxml.jackson.databind.ser包,在下文中一共展示了DefaultSerializerProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: serializeBigIntXWithNanoPlotType_resultJsonHasStringXs

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeBigIntXWithNanoPlotType_resultJsonHasStringXs() throws IOException {
  //when
  ConstantBand constantBand = new ConstantBand();
  constantBand.setX(
      Arrays.asList(
          new BigInteger("12345678901234567891000"), new BigInteger("12345678901234567892000")));
  constantBand.setPlotType(NanoPlot.class);
  constantBandSerializer.serialize(constantBand, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("x")).isTrue();
  ArrayNode arrayNode = (ArrayNode) actualObj.get("x");
  Assertions.assertThat(arrayNode.get(0).isTextual()).isTrue();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:17,代码来源:ConstantBandSerializerTest.java

示例2: serializeDataOfHeatMap_resultJsonHasGraphicsList

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeDataOfHeatMap_resultJsonHasGraphicsList() throws IOException {
  //when
  HeatMap heatMap = new HeatMap();
  heatMap.setData(
      new Integer[][] {
        new Integer[] {new Integer(1), new Integer(2)},
        new Integer[] {new Integer(3), new Integer(4)}
      });
  heatMapSerializer.serialize(heatMap, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("graphics_list")).isTrue();
  Assertions.assertThat(actualObj.get("graphics_list")).isNotEmpty();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:17,代码来源:HeatMapSerializerTest.java

示例3: serializeClickActionLineGraphics_resultJsonHasClickAction

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeClickActionLineGraphics_resultJsonHasClickAction() throws IOException {
  //when
  Line line = new Line();
  line.onClick(
      new GraphicsActionListener() {
        @Override
        public void execute(GraphicsActionObject actionObject) {}
      });
  graphicsSerializer.serialize(line, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("hasClickAction")).isTrue();
  Assertions.assertThat(actualObj.get("hasClickAction").asBoolean()).isTrue();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:17,代码来源:GraphicsSerializerTest.java

示例4: serializeObject

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
public JsonNode serializeObject(V value) throws IOException {
  StringWriter sw = new StringWriter();
  JsonGenerator jgen = mapper.getFactory().createGenerator(sw);
  serializer.serialize(value, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  return mapper.readTree(sw.toString());
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:8,代码来源:SerializationTestHelper.java

示例5: serializeXOfXYGraphicsLine_resultJsonHasX

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeXOfXYGraphicsLine_resultJsonHasX() throws IOException {
  //when
  line.setX(Arrays.asList(1, 2, 3));
  xyGraphicsSerializer.serialize(line, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("x")).isTrue();
  Assertions.assertThat(actualObj.get("x")).isNotEmpty();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:12,代码来源:XYGraphicsSerializerTest.java

示例6: serializeBigIntXWithNanoPlotType_resultJsonHasStringX

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeBigIntXWithNanoPlotType_resultJsonHasStringX() throws IOException {
  //when
  line.setX(
      Arrays.asList(
          new BigInteger("12345678901234567891000"), new BigInteger("12345678901234567891000")));
  line.setPlotType(NanoPlot.class);
  xyGraphicsSerializer.serialize(line, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("x")).isTrue();
  ArrayNode arrayNode = (ArrayNode) actualObj.get("x");
  Assertions.assertThat(arrayNode.get(1).isTextual()).isTrue();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:16,代码来源:XYGraphicsSerializerTest.java

示例7: serializeYOfXYGraphicsLine_resultJsonHasY

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeYOfXYGraphicsLine_resultJsonHasY() throws IOException {
  //when
  line.setY(Arrays.asList(1, 2, 3));
  xyGraphicsSerializer.serialize(line, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("y")).isTrue();
  Assertions.assertThat(actualObj.get("y")).isNotEmpty();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:12,代码来源:XYGraphicsSerializerTest.java

示例8: serializeDataListListOfHistogram_resultJsonHasGraphicsList

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeDataListListOfHistogram_resultJsonHasGraphicsList() throws IOException {
  //when
  histogram.setData(Arrays.asList(Arrays.asList(1, 2), Arrays.asList(3, 4)));
  histogramSerializer.serialize(histogram, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("graphics_list")).isTrue();
  Assertions.assertThat(actualObj.get("graphics_list")).isNotEmpty();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:12,代码来源:HistogramSerializerTest.java

示例9: serializeLodFilterOfXYGraphicsLine_resultJsonHasLodFilter

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeLodFilterOfXYGraphicsLine_resultJsonHasLodFilter() throws IOException {
  //when
  line.setLodFilter(Filter.LINE);
  xyGraphicsSerializer.serialize(line, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("lod_filter")).isTrue();
  Assertions.assertThat(actualObj.get("lod_filter").asText()).isEqualTo("line");
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:12,代码来源:XYGraphicsSerializerTest.java

示例10: serializeLogOfHistogram_resultJsonHasLog

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeLogOfHistogram_resultJsonHasLog() throws IOException {
  //when
  histogram.setLog(true);
  histogramSerializer.serialize(histogram, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("log")).isTrue();
  Assertions.assertThat(actualObj.get("log").asBoolean()).isTrue();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:12,代码来源:HistogramSerializerTest.java

示例11: serializeConstantBand_resultJsonHasType

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeConstantBand_resultJsonHasType() throws IOException {
  //when
  ConstantBand constantBand = new ConstantBand();
  constantBandSerializer.serialize(constantBand, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("type")).isTrue();
  Assertions.assertThat(actualObj.get("type").asText()).isEqualTo("ConstantBand");
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:12,代码来源:ConstantBandSerializerTest.java

示例12: serializeDisplayModeOfHistogram_resultJsonHasDisplayMode

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeDisplayModeOfHistogram_resultJsonHasDisplayMode() throws IOException {
  //when
  histogram.setDisplayMode(Histogram.DisplayMode.STACK);
  histogramSerializer.serialize(histogram, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("displayMode")).isTrue();
  Assertions.assertThat(actualObj.get("displayMode").asText()).isEqualTo("STACK");
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:12,代码来源:HistogramSerializerTest.java

示例13: serializeNamesOfHistogram_resultJsonHasNames

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeNamesOfHistogram_resultJsonHasNames() throws IOException {
  //when
  histogram.setNames(Arrays.asList("name1", "name2"));
  histogramSerializer.serialize(histogram, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("names")).isTrue();
  ArrayNode arrayNode = (ArrayNode) actualObj.get("names");
  Assertions.assertThat(arrayNode.get(1).asText()).isEqualTo("name2");
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:13,代码来源:HistogramSerializerTest.java

示例14: serializeVisibleConstantBand_resultJsonHasVisible

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeVisibleConstantBand_resultJsonHasVisible() throws IOException {
  //when
  ConstantBand constantBand = new ConstantBand();
  constantBand.setVisible(true);
  constantBandSerializer.serialize(constantBand, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("visible")).isTrue();
  Assertions.assertThat(actualObj.get("visible").asBoolean()).isTrue();
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:13,代码来源:ConstantBandSerializerTest.java

示例15: serializeYAxisConstantBand_resultJsonHasYAxis

import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider; //导入依赖的package包/类
@Test
public void serializeYAxisConstantBand_resultJsonHasYAxis() throws IOException {
  //when
  ConstantBand constantBand = new ConstantBand();
  constantBand.setyAxis("Y Axis name");
  constantBandSerializer.serialize(constantBand, jgen, new DefaultSerializerProvider.Impl());
  jgen.flush();
  //then
  JsonNode actualObj = mapper.readTree(sw.toString());
  Assertions.assertThat(actualObj.has("yAxis")).isTrue();
  Assertions.assertThat(actualObj.get("yAxis").asText()).isEqualTo("Y Axis name");
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:13,代码来源:ConstantBandSerializerTest.java


注:本文中的com.fasterxml.jackson.databind.ser.DefaultSerializerProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。