0

当我将 java-object 转换为 json-string 时,我尝试组织动态 @JsonIgnore 属性。在示例 中,它适用于 (codehause jackson) ObjectMapper oMapper = new ObjectMapper(); oMapper。设置序列化配置(...

或以更快的xml objectMapper.getSerializationConfig()为例。setSerializationView (

问题:我的杰克逊没有粗体方法:

pom.xml

<jackson.version>2.1.1</jackson.version>
<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-databind</artifactId>
  <version>${jackson.version}</version>
</dependency>
<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-core</artifactId>
  <version>${jackson.version}</version>
</dependency>
<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-annotations</artifactId>
  <version>${jackson.version}</version>
</dependency>
4

1 回答 1

1

看看哪些确实包含设置要使用ObjectWriterObjectReader活动视图的功能。这与 Jackson 1.x 不同,后者通过SerializationConfig和暴露它们DeserializationConfigObjectMapper您可以从(mapper.readerXxx() 和 mapper.writerXxx())构造这些对象;它们是可重用的,并且提供比ObjectMapper.

于 2013-08-05T23:42:08.507 回答