GVKun编程网logo

杰克逊-@JsonTypeInfo属性被映射为null?(杰克逊in the closet)

15

关于杰克逊-@JsonTypeInfo属性被映射为null?和杰克逊inthecloset的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于.net–AssemblyInfo属性如何映射到W

关于杰克逊-@JsonTypeInfo属性被映射为null?杰克逊in the closet的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于.net – AssemblyInfo属性如何映射到Win32 VERSIONINFO?、@JsonInclude注解,RestTemplate传输值为null的属性,利用FastJson将属性中有空值null的对象转化成Json字符串、c++中获得对象类型 typeid 与 type_info、com.fasterxml.jackson.annotation.JsonTypeInfo.As的实例源码等相关知识的信息别忘了在本站进行查找喔。

本文目录一览:

杰克逊-@JsonTypeInfo属性被映射为null?(杰克逊in the closet)

杰克逊-@JsonTypeInfo属性被映射为null?(杰克逊in the closet)

我有这个回应:

{      "id":"decaa828741611e58bcffeff819cdc9f",    "statement":"question statement",    "exercise_type":"QUESTION"}

然后,我要基于 exercise_type 属性实例化不同的对象实例(的子类ExerciseResponseDTO),因此我在以下位置创建此混合:

@JsonTypeInfo(      use = JsonTypeInfo.Id.NAME,      include = JsonTypeInfo.As.PROPERTY,      property = "exercise_type")  @JsonSubTypes({      @Type(value = ExerciseChoiceResponseDTO.class, name = "CHOICE"),      @Type(value = ExerciseQuestionResponseDTO.class, name = "QUESTION")})  public abstract class ExerciseMixIn  {}public abstract class ExerciseResponseDTO {    private String id;    private String statement;    @JsonProperty(value = "exercise_type") private String exerciseType;    // Getters and setters }public class ExerciseQuestionResponseDTO    extends ExerciseResponseDTO {}public class ExerciseChoiceResponseDTO    extends ExerciseResponseDTO {}

所以我创建ObjectMapper如下

ObjectMapper mapper = new ObjectMapper();mapper.addMixIn(ExerciseResponseDTO.class, ExerciseMixIn.class);

我的测试:

ExerciseResponseDTO exercise = mapper.readValue(serviceResponse, ExerciseResponseDTO.class)Assert.assertTrue(exercise.getClass() == ExerciseQuestionResponseDTO.class); // OKAssert.assertEquals("decaa828741611e58bcffeff819cdc9f" exercise.getId()); // OKAssert.assertEquals("question statement", exercise.getStatement()); // OKAssert.assertEquals("QUESTION", exercise.getExerciseType()); // FAIL. Expected: "QUESTION", actual: null

问题在于,由于某种原因,用作属性on 的 exercise_type 属性@JsonTypeInfo被映射为 null 。知道我该如何解决吗?

答案1

小编典典

最后,我在API文档中找到了解决方案

关于类型标识符可见性的注意事项:默认情况下,类型标识符的反序列化(在读取JSON时使用)完全由Jackson进行处理,并且不会传递给反序列化器。但是,如果需要,可以定义属性visible
= true,在这种情况下,属性将在反序列化时按原样传递给解串器(并通过setter或field进行设置)。

因此,解决方案只是添加“ visible ”属性,如下所示

@JsonTypeInfo(      use = JsonTypeInfo.Id.NAME,      include = JsonTypeInfo.As.PROPERTY,      property = "exercise_type",    visible = true)  @JsonSubTypes({      @Type(value = ExerciseChoiceResponseDTO.class, name = "CHOICE"),      @Type(value = ExerciseQuestionResponseDTO.class, name = "QUESTION")})  public abstract class ExerciseMixIn  {}

希望这对其他人有帮助。

.net – AssemblyInfo属性如何映射到Win32 VERSIONINFO?

.net – AssemblyInfo属性如何映射到Win32 VERSIONINFO?

当您查看包含VERSIONINFO资源的二进制文件的属性时,Windows会添加一个“版本”选项卡,该选项卡显示该信息.

是否有一个列表,其中的.NET程序集属性映射到哪些VERSIONINFO字段,因此我们可以轻松地为.NET程序集控制这些属性?

关于“固定信息”:

PRODUCTVERSION和FILeverSION分别来自[AssemblyinformationalVersion]和[AssemblyFiLeversion].

FILEOS,FILETYPE很可能是由编译器设置的.

关于Var File Info

[AssemblyCulture]映射到“翻译”(我猜!)

关于String File Info

[AssemblyCompany]映射到“CompanyName”
[AssemblyDescription]映射到“评论”
[AssemblyFiLeversion]映射到“FiLeversion”
[AssemblyTitle]映射到“FileDescription”
[AssemblyinformationalVersion]映射到“ProductVersion”
[AssemblyProduct]映射到“ProductName”
[Assemblycopyright]映射到“Legalcopyright”

我认为“InternalName”和“OriginalFile”分别设置为DLL或EXE的名称.

@JsonInclude注解,RestTemplate传输值为null的属性,利用FastJson将属性中有空值null的对象转化成Json字符串

@JsonInclude注解,RestTemplate传输值为null的属性,利用FastJson将属性中有空值null的对象转化成Json字符串

 

一个pojo类:

import lombok.Data;

@Data
public class Friend {
    private String name;
    private int age;
    private String sex;
}

 

初始化一个Friend对象,该对象属性为"sex"对应的值设置为null:

public class FriendTest {
    private Friend friend = new Friend();

    @Before
    public void init(){
        friend.setAge(26);
        friend.setName("xiaofang");
        friend.setSex(null);
    }

 

使用FastJson将该对象转化为Json字符串:

@Test
    public void testObjectToJson(){
        String jsonString = JSONObject.toJSONString(friend);
        System.out.println(jsonString);
    }

 

可以看到,"sex"字段由于为null,转化时该字段没了。

设置序列化类型

@Test
    public void testJsonSerializer(){
        String jsonString = JSONObject.toJSONString(friend, SerializerFeature.WriteMapNullValue);
        System.out.println(jsonString);
    }

就有值为null的属性了。

 

 

RestTemplate传输值为null的属性

使用RestTemplate传输该Friend对象时,值为null的属性会被忽略掉,但是我们在某些情况下想要传输值为null属性,我们可以在该字段上加上com.fasterxml.jackson.annotation.@JsonInclude注解,通过RestTemplate传输,就不会忽略值为null的属性。

 

c++中获得对象类型 typeid 与 type_info

c++中获得对象类型 typeid 与 type_info

复杂部分略去,摘录要素如下:

1.typeid是C++的关键字之一,等同于sizeof这类的操作符。

2.typeid操作符的返回结果是名为type_info的标准库类型的对象的引用(在头文件typeinfo中定义)

3.C++并没有规定typeid实现标准,各个编译器可能会不一样。

4.编译器会为每一种typeid操作的类型生成一份保存在数据段的type_info数据。

5.每种类型的type_info数据长度依赖于类型名称,至少9个字节。

 

 


个人实测总结如下:


1.返回类型


typeid返回的是type_info的引用,这个类不能拷贝,也不能自己构造。
在语法上要使用const type_info & 类型来定义一个对象

type_info.name()的返回类型是一个const char* 静态字符串


2.可用操作集
-> 创建一个引用对象  const type_info& t0 = typeid(int);

-> 获得类型名称 const char* b=t0.name();

cout<<b<<" " <<t0.name()<<endl;

->比较对象是否相等,仅支持2种比较符
t1 == t2 ,t1 != t2 

 


程序实例:

#include<iostream>
#include<typeinfo>
#include<cstring>
using namespace std;

int main(void){
int i = 1;
float f = 1.222;

//定义引用对象
const type_info& t1 = typeid(f);
const type_info& t2 = typeid(int);
//获得类型名称
const char* a=t1.name();
const char* b=t1.name();
//比较对象相等
cout<<"ti==t2 ? "<< t1==t2<<endl;

return 0;
}


3.不同编译器的机能的理解

在devc++5.11中

float f = 1.222;
cout<<typeid(f).name();
输出
>>f
在vs2013中

float f = 1.222;
cout<<typeid(f).name();
输出
>>float
可见简陋的devc++,对于变量的类型处理不科学。

会直接创建一个新的type_info对象,储存的private:name 是传入的变量名称

 

但是在devc++中直接输入类型名称是可以的

float f = 1.222;
cout<<typeid(float).name();
输出
>>float
只要输入的是类型名称,后续的其他操作,例如比较typeid(float)==typeid(int),在devc++中都是正常的。

com.fasterxml.jackson.annotation.JsonTypeInfo.As的实例源码

com.fasterxml.jackson.annotation.JsonTypeInfo.As的实例源码

项目:org.ops4j.ramler    文件:PojoGeneratingApiVisitor.java   
private void addJsonTypeInfo(JDefinedClass klass,ObjectTypeDeclaration type) {
    if (!context.getConfig().isJacksonTypeInfo()) {
        return;
    }
    if (type.discriminator() == null) {
        return;
    }
    List<String> derivedTypes = context.getApiModel().findDerivedTypes(type.name());
    if (derivedTypes.isEmpty()) {
        return;
    }
    JAnnotationUse typeInfo = klass.annotate(JsonTypeInfo.class);
    typeInfo.param("use",Id.NAME);
    typeInfo.param("include",As.EXISTING_PROPERTY);
    typeInfo.param("property",type.discriminator());

    JAnnotationUse subTypes = klass.annotate(JsonSubTypes.class);
    JAnnotationArrayMember typeArray = subTypes.paramArray(VALUE);

    for (String derivedType : derivedTypes) {
        JDefinedClass subtype = pkg._getClass(derivedType);
        typeArray.annotate(Type.class).param(VALUE,subtype);
    }
}
项目:gwt-jackson    文件:AbstractBeanjsonCreator.java   
/**
 * Build the code to initialize a {@link TypeSerializationInfo} or {@link TypeDeserializationInfo}.
 *
 * @param typeInfo the type information obtained through the {@link JsonTypeInfo} annotation
 * @return the code built
 */
protected final CodeBlock generateTypeInfo( BeanTypeInfo typeInfo ) {

    Class type;
    ImmutableMap<JClasstype,String> mapTypetoMetadata;
    if ( isSerializer() ) {
        type = TypeSerializationInfo.class;
        mapTypetoMetadata = typeInfo.getMapTypetoSerializationMetadata();
    } else {
        type = TypeDeserializationInfo.class;
        mapTypetoMetadata = typeInfo.getMapTypetoDeserializationMetadata();
    }

    CodeBlock.Builder builder = CodeBlock.builder()
            .add( "new $T($T.$L,$S)",type,As.class,typeInfo.getInclude(),typeInfo.getPropertyName() )
            .indent()
            .indent();

    for ( Entry<JClasstype,String> entry : mapTypetoMetadata.entrySet() ) {
        builder.add( "\n.addTypeInfo($T.class,rawName( entry.getKey() ),entry.getValue() );
    }

    return builder.unindent().unindent().build();
}
项目:gwt-jackson    文件:BeanProcessor.java   
/**
 * Process the properties of the bean to find additionnal informations like @JsonValue.
 *
 * @param configuration the configuration
 * @param logger the logger
 * @param typeOracle the oracle
 * @param beanInfo the prevIoUs bean information
 * @param properties the properties of the bean
 * @return the new informations about the bean and its properties
 */
public static BeanInfo processproperties( RebindConfiguration configuration,TreeLogger logger,JacksonTypeOracle typeOracle,BeanInfo beanInfo,PropertiesContainer properties ) {
    if ( !properties.getValuePropertyInfo().isPresent() && !properties.getAnyGetterPropertyInfo().isPresent() && !properties
            .getAnySetterPropertyInfo().isPresent() ) {
        return beanInfo;
    }

    BeanInfoBuilder builder = new BeanInfoBuilder( beanInfo );
    builder.setValuePropertyInfo( properties.getValuePropertyInfo() );

    if ( properties.getValuePropertyInfo().isPresent() && beanInfo.getTypeInfo().isPresent() && As.PROPERTY.equals( beanInfo
            .getTypeInfo().get().getInclude() ) ) {
        // if the bean has type info on property with @JsonValue,we change it to WRAPPER_ARRAY because the value may not be an object
        BeanTypeInfo typeInfo = beanInfo.getTypeInfo().get();
        builder.setTypeInfo( Optional.of( new BeanTypeInfo( typeInfo.getUse(),As.WRAPPER_ARRAY,typeInfo
                .getPropertyName(),typeInfo.getMapTypetoSerializationMetadata(),typeInfo.getMapTypetoDeserializationMetadata() ) ) );
    }

    builder.setAnyGetterPropertyInfo( properties.getAnyGetterPropertyInfo() );
    builder.setAnySetterPropertyInfo( properties.getAnySetterPropertyInfo() );

    return builder.build();
}
项目:CityPower-Build-Sample    文件:CacheConfig.java   
private Jackson2JsonRedisSerializer jsonRedisSerializer(JavaType javaType)
{
    Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(javaType);
    ObjectMapper mapper = new ObjectMapper();
    mapper.enableDefaultTyping();
    mapper.enableDefaultTyping(DefaultTyping.NON_FINAL,As.PROPERTY);

    mapper.findAndRegisterModules();
    mapper.registerModule(new Jackson2HalModule());
    mapper.setHandlerInstantiator(new Jackson2HalModule.HalHandlerInstantiator(new DefaultRelProvider(),null,null));        
    jackson2JsonRedisSerializer.setobjectMapper(mapper);        
    return jackson2JsonRedisSerializer;
}
项目:QuizUpWinner    文件:StdTypeResolverBuilder.java   
public StdTypeResolverBuilder inclusion(JsonTypeInfo.As paramAs)
{
  if (paramAs == null)
    throw new IllegalArgumentException("includeAs can not be null");
  this._includeAs = paramAs;
  return this;
}
项目:QuizUpWinner    文件:JacksonAnnotationIntrospector.java   
protected TypeResolverBuilder<?> _findTypeResolver(MapperConfig<?> paramMapperConfig,Annotated paramAnnotated,JavaType paramJavaType)
{
  JsonTypeInfo localJsonTypeInfo = (JsonTypeInfo)paramAnnotated.getAnnotation(JsonTypeInfo.class);
  JsonTypeResolver localJsonTypeResolver = (JsonTypeResolver)paramAnnotated.getAnnotation(JsonTypeResolver.class);
  Object localObject;
  if (localJsonTypeResolver != null)
  {
    if (localJsonTypeInfo == null)
      return null;
    localObject = paramMapperConfig.typeResolverBuilderInstance(paramAnnotated,localJsonTypeResolver.value());
  }
  else
  {
    if (localJsonTypeInfo == null)
      return null;
    if (localJsonTypeInfo.use() == JsonTypeInfo.Id.NONE)
      return _constructNoTypeResolverBuilder();
    localObject = _constructStdTypeResolverBuilder();
  }
  JsonTypeIdResolver localJsonTypeIdResolver = (JsonTypeIdResolver)paramAnnotated.getAnnotation(JsonTypeIdResolver.class);
  TypeIdResolver localTypeIdResolver1;
  if (localJsonTypeIdResolver == null)
    localTypeIdResolver1 = null;
  else
    localTypeIdResolver1 = paramMapperConfig.typeIdResolverInstance(paramAnnotated,localJsonTypeIdResolver.value());
  TypeIdResolver localTypeIdResolver2 = localTypeIdResolver1;
  if (localTypeIdResolver1 != null)
    localTypeIdResolver2.init(paramJavaType);
  TypeResolverBuilder localTypeResolverBuilder1 = ((TypeResolverBuilder)localObject).init(localJsonTypeInfo.use(),localTypeIdResolver2);
  JsonTypeInfo.As localAs1 = localJsonTypeInfo.include();
  JsonTypeInfo.As localAs2 = localAs1;
  if ((localAs1 == JsonTypeInfo.As.EXTERNAL_PROPERTY) && ((paramAnnotated instanceof AnnotatedClass)))
    localAs2 = JsonTypeInfo.As.PROPERTY;
  TypeResolverBuilder localTypeResolverBuilder2 = localTypeResolverBuilder1.inclusion(localAs2).typeProperty(localJsonTypeInfo.property());
  Class localClass = localJsonTypeInfo.defaultImpl();
  if (localClass != JsonTypeInfo.None.class)
    localTypeResolverBuilder2 = localTypeResolverBuilder2.defaultImpl(localClass);
  return localTypeResolverBuilder2.typeIdVisibility(localJsonTypeInfo.visible());
}
项目:simple-spring-memcached    文件:JsonObjectMapper.java   
public JsonObjectMapper() {
    registerModule(module);

    configure(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS,true);
    configure(SerializationFeature.FAIL_ON_EMPTY_BEANS,false);
    enableDefaultTyping(DefaultTyping.NON_FINAL,As.WRAPPER_OBJECT);

    typer = new ClassAliasTypeResolverBuilder(DefaultTyping.NON_FINAL);
    setDefaultTyping(typer.inclusion(As.WRAPPER_OBJECT));
}
项目:gwt-jackson    文件:BeanProcessor.java   
/**
 * <p>processtype</p>
 *
 * @param logger a {@link com.google.gwt.core.ext.TreeLogger} object.
 * @param typeOracle a {@link com.github.nmorel.gwtjackson.rebind.JacksonTypeOracle} object.
 * @param configuration a {@link com.github.nmorel.gwtjackson.rebind.RebindConfiguration} object.
 * @param typeOracle a {@link com.github.nmorel.gwtjackson.rebind.JacksonTypeOracle} object.
 * @param type a {@link com.google.gwt.core.ext.typeinfo.JClasstype} object.
 * @param jsonTypeInfo a {@link com.google.gwt.thirdparty.guava.common.base.Optional} object.
 * @param propertySubTypes a {@link com.google.gwt.thirdparty.guava.common.base.Optional} object.
 * @return a {@link com.google.gwt.thirdparty.guava.common.base.Optional} object.
 * @throws com.google.gwt.core.ext.UnabletoCompleteException if any.
 */
public static Optional<BeanTypeInfo> processtype( TreeLogger logger,RebindConfiguration configuration,JClasstype type,Optional<JsonTypeInfo> jsonTypeInfo,Optional<JsonSubTypes>
        propertySubTypes ) throws UnabletoCompleteException {

    if ( !jsonTypeInfo.isPresent() ) {
        jsonTypeInfo = findFirstEncounteredAnnotationsOnAllHierarchy( configuration,JsonTypeInfo.class );
        if ( !jsonTypeInfo.isPresent() ) {
            return Optional.absent();
        }
    }

    Id use = jsonTypeInfo.get().use();
    As include = jsonTypeInfo.get().include();
    String propertyName = jsonTypeInfo.get().property().isEmpty() ? jsonTypeInfo.get().use().getDefaultPropertyName() : jsonTypeInfo
            .get().property();

    Optional<JsonSubTypes> typeSubTypes = findFirstEncounteredAnnotationsOnAllHierarchy( configuration,JsonSubTypes.class );

    // Todo we Could do better,we actually extract Metadata twice for a lot of classes
    ImmutableMap<JClasstype,String> classtoSerializationMetadata = extractMetadata( logger,configuration,jsonTypeInfo,propertySubTypes,typeSubTypes,CreatorUtils
                    .filterSubtypesForSerialization( logger,type ) );
    ImmutableMap<JClasstype,String> classtoDeserializationMetadata = extractMetadata( logger,CreatorUtils
                    .filterSubtypesForDeserialization( logger,type ) );

    return Optional.of(
            new BeanTypeInfo( use,include,propertyName,classtoSerializationMetadata,classtoDeserializationMetadata ) );
}
项目:gwt-jackson    文件:BeanTypeInfo.java   
BeanTypeInfo( Id use,As include,String propertyName,ImmutableMap<JClasstype,String> mapTypetoSerializationMetadata,String> mapTypetoDeserializationMetadata ) {
    this.use = use;
    this.include = include;
    this.propertyName = propertyName;
    this.mapTypetoSerializationMetadata = mapTypetoSerializationMetadata;
    this.mapTypetoDeserializationMetadata = mapTypetoDeserializationMetadata;
}
项目:antioch    文件:SearchResult.java   
@JsonTypeInfo(use = Id.NAME,include = As.EXISTING_PROPERTY)
public AntiochQuery getQuery() {
  return query;
}
项目:QuizUpWinner    文件:AsPropertyTypeDeserializer.java   
public JsonTypeInfo.As getTypeInclusion()
{
  return JsonTypeInfo.As.PROPERTY;
}
项目:QuizUpWinner    文件:AsArrayTypeDeserializer.java   
public JsonTypeInfo.As getTypeInclusion()
{
  return JsonTypeInfo.As.WRAPPER_ARRAY;
}
项目:QuizUpWinner    文件:AsWrapperTypeDeserializer.java   
public JsonTypeInfo.As getTypeInclusion()
{
  return JsonTypeInfo.As.WRAPPER_OBJECT;
}
项目:QuizUpWinner    文件:AsWrapperTypeSerializer.java   
public JsonTypeInfo.As getTypeInclusion()
{
  return JsonTypeInfo.As.WRAPPER_OBJECT;
}
项目:QuizUpWinner    文件:AsPropertyTypeSerializer.java   
public JsonTypeInfo.As getTypeInclusion()
{
  return JsonTypeInfo.As.PROPERTY;
}
项目:QuizUpWinner    文件:AsArrayTypeSerializer.java   
public JsonTypeInfo.As getTypeInclusion()
{
  return JsonTypeInfo.As.WRAPPER_ARRAY;
}
项目:QuizUpWinner    文件:AsExternalTypeDeserializer.java   
public JsonTypeInfo.As getTypeInclusion()
{
  return JsonTypeInfo.As.EXTERNAL_PROPERTY;
}
项目:QuizUpWinner    文件:AsExternalTypeSerializer.java   
public JsonTypeInfo.As getTypeInclusion()
{
  return JsonTypeInfo.As.EXTERNAL_PROPERTY;
}
项目:coala    文件:Identifiable.java   
/** @return the identifier */
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS,include=As.PROPERTY,property="class")
ID getID();
项目:joyplus-tv    文件:AsPropertyTypeDeserializer.java   
@Override
public As getTypeInclusion() {
    return As.PROPERTY;
}
项目:joyplus-tv    文件:AsArrayTypeDeserializer.java   
@Override
public As getTypeInclusion() {
    return As.WRAPPER_ARRAY;
}
项目:joyplus-tv    文件:AsWrapperTypeDeserializer.java   
@Override
public As getTypeInclusion() {
    return As.WRAPPER_OBJECT;
}
项目:joyplus-tv    文件:AsWrapperTypeSerializer.java   
@Override
public As getTypeInclusion() { return As.WRAPPER_OBJECT; }
项目:joyplus-tv    文件:AsPropertyTypeSerializer.java   
@Override
public As getTypeInclusion() { return As.PROPERTY; }
项目:joyplus-tv    文件:AsArrayTypeSerializer.java   
@Override
public As getTypeInclusion() { return As.WRAPPER_ARRAY; }
项目:joyplus-tv    文件:AsExternalTypeDeserializer.java   
@Override
public As getTypeInclusion() {
    return As.EXTERNAL_PROPERTY;
}
项目:joyplus-tv    文件:AsExternalTypeSerializer.java   
@Override
public As getTypeInclusion() { return As.EXTERNAL_PROPERTY; }
项目:gwt-jackson-apt    文件:TypeSerializationInfo.java   
/**
 * <p>Constructor for TypeSerializationInfo.</p>
 *
 * @param include      a {@link com.fasterxml.jackson.annotation.JsonTypeInfo.As} object.
 * @param propertyName a {@link String} object.
 */
public TypeSerializationInfo(As include,String propertyName) {
    this.include = include;
    this.propertyName = propertyName;
    this.typeClasstoInfo = new HashMap<Class<? extends T>,String>();
}
项目:gwt-jackson-apt    文件:TypeSerializationInfo.java   
/**
 * <p>Getter for the field <code>include</code>.</p>
 *
 * @return a {@link com.fasterxml.jackson.annotation.JsonTypeInfo.As} object.
 */
public As getInclude() {
    return include;
}
项目:gwt-jackson-apt    文件:TypeDeserializationInfo.java   
/**
 * <p>Constructor for TypeDeserializationInfo.</p>
 *
 * @param include      a {@link As} object.
 * @param propertyName a {@link String} object.
 */
public TypeDeserializationInfo(As include,String propertyName) {
    this.include = include;
    this.propertyName = propertyName;
    this.typeInfoToClass = new HashMap<String,Class<? extends T>>();
}
项目:gwt-jackson-apt    文件:TypeDeserializationInfo.java   
/**
 * <p>Getter for the field <code>include</code>.</p>
 *
 * @return a {@link As} object.
 */
public As getInclude() {
    return include;
}
项目:gwt-jackson    文件:TypeSerializationInfo.java   
/**
 * <p>Constructor for TypeSerializationInfo.</p>
 *
 * @param include a {@link com.fasterxml.jackson.annotation.JsonTypeInfo.As} object.
 * @param propertyName a {@link java.lang.String} object.
 */
public TypeSerializationInfo( As include,String propertyName ) {
    this.include = include;
    this.propertyName = propertyName;
    this.typeClasstoInfo = new HashMap<Class<? extends T>,String>();
}
项目:gwt-jackson    文件:TypeSerializationInfo.java   
/**
 * <p>Getter for the field <code>include</code>.</p>
 *
 * @return a {@link com.fasterxml.jackson.annotation.JsonTypeInfo.As} object.
 */
public As getInclude() {
    return include;
}
项目:gwt-jackson    文件:TypeDeserializationInfo.java   
/**
 * <p>Constructor for TypeDeserializationInfo.</p>
 *
 * @param include a {@link com.fasterxml.jackson.annotation.JsonTypeInfo.As} object.
 * @param propertyName a {@link java.lang.String} object.
 */
public TypeDeserializationInfo( As include,String propertyName ) {
    this.include = include;
    this.propertyName = propertyName;
    this.typeInfoToClass = new HashMap<String,Class<? extends T>>();
}
项目:gwt-jackson    文件:TypeDeserializationInfo.java   
/**
 * <p>Getter for the field <code>include</code>.</p>
 *
 * @return a {@link com.fasterxml.jackson.annotation.JsonTypeInfo.As} object.
 */
public As getInclude() {
    return include;
}
项目:gwt-jackson    文件:BeanTypeInfo.java   
/**
 * <p>Getter for the field <code>include</code>.</p>
 *
 * @return a {@link com.fasterxml.jackson.annotation.JsonTypeInfo.As} object.
 */
public As getInclude() {
    return include;
}
项目:joyplus-tv    文件:TypeDeserializer.java   
/**
 * Accessor for type information inclusion method
 * that deserializer uses; indicates how type information
 * is (expected to be) embedded in JSON input.
 */
public abstract As getTypeInclusion();
项目:joyplus-tv    文件:TypeResolverBuilder.java   
/**
 * Method for specifying mechanism to use for including type Metadata
 * in JSON.
 * If not explicitly called,setting defaults to
 * {@link As#PROPERTY}.
 * 
 * @param includeAs Mechanism used for including type Metadata in JSON
 * 
 * @return Resulting builder instance (usually this builder,*   but not necessarily)
 */
public T inclusion(As includeAs);
项目:QuizUpWinner    文件:TypeDeserializer.java   
public abstract JsonTypeInfo.As getTypeInclusion();
项目:QuizUpWinner    文件:TypeSerializer.java   
public abstract JsonTypeInfo.As getTypeInclusion();

关于杰克逊-@JsonTypeInfo属性被映射为null?杰克逊in the closet的介绍已经告一段落,感谢您的耐心阅读,如果想了解更多关于.net – AssemblyInfo属性如何映射到Win32 VERSIONINFO?、@JsonInclude注解,RestTemplate传输值为null的属性,利用FastJson将属性中有空值null的对象转化成Json字符串、c++中获得对象类型 typeid 与 type_info、com.fasterxml.jackson.annotation.JsonTypeInfo.As的实例源码的相关信息,请在本站寻找。

本文标签: