org.codehaus.jackson.map.JsonSerializer.isUnwrappingSerializer()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.codehaus.jackson.map.JsonSerializer.isUnwrappingSerializer()方法的一些代码示例,展示了JsonSerializer.isUnwrappingSerializer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonSerializer.isUnwrappingSerializer()方法的具体详情如下:
包路径:org.codehaus.jackson.map.JsonSerializer
类名称:JsonSerializer
方法名:isUnwrappingSerializer

JsonSerializer.isUnwrappingSerializer介绍

[英]Accessor for checking whether this serializer is an "unwrapping" serializer; this is necessary to know since it may also require caller to suppress writing of the leading property name.
[中]用于检查此序列化程序是否为“展开”序列化程序的访问器;这是必须知道的,因为它可能还要求调用方禁止写入前导属性名。

代码示例

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

@Override
public BeanPropertyWriter withSerializer(JsonSerializer<Object> ser)
{
  if (getClass() != UnwrappingBeanPropertyWriter.class) {
    throw new IllegalStateException("UnwrappingBeanPropertyWriter sub-class does not override 'withSerializer()'; needs to!");
  }
  // better try to create unwrapping instance
  if (!ser.isUnwrappingSerializer()) {
    ser = ser.unwrappingSerializer();
  }
  return new UnwrappingBeanPropertyWriter(this, ser);
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

@Override
  protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map,
      Class<?> type, SerializerProvider provider) throws JsonMappingException
  {
    JsonSerializer<Object> serializer;
    if (_nonTrivialBaseType != null) {
      JavaType subtype = provider.constructSpecializedType(_nonTrivialBaseType, type);
      serializer = provider.findValueSerializer(subtype, this);
    } else {
      serializer = provider.findValueSerializer(type, this);
    }
    if (!serializer.isUnwrappingSerializer()) {
      serializer = serializer.unwrappingSerializer();
    }
    _dynamicSerializers = _dynamicSerializers.newWith(type, serializer);
    return serializer;
  }
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

if (!ser.isUnwrappingSerializer()) {
  jgen.writeFieldName(_name);

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public BeanPropertyWriter withSerializer(JsonSerializer<Object> ser)
{
  if (getClass() != UnwrappingBeanPropertyWriter.class) {
    throw new IllegalStateException("UnwrappingBeanPropertyWriter sub-class does not override 'withSerializer()'; needs to!");
  }
  // better try to create unwrapping instance
  if (!ser.isUnwrappingSerializer()) {
    ser = ser.unwrappingSerializer();
  }
  return new UnwrappingBeanPropertyWriter(this, ser);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
  protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map,
      Class<?> type, SerializerProvider provider) throws JsonMappingException
  {
    JsonSerializer<Object> serializer;
    if (_nonTrivialBaseType != null) {
      JavaType subtype = provider.constructSpecializedType(_nonTrivialBaseType, type);
      serializer = provider.findValueSerializer(subtype, this);
    } else {
      serializer = provider.findValueSerializer(type, this);
    }
    if (!serializer.isUnwrappingSerializer()) {
      serializer = serializer.unwrappingSerializer();
    }
    _dynamicSerializers = _dynamicSerializers.newWith(type, serializer);
    return serializer;
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

if (!ser.isUnwrappingSerializer()) {
  jgen.writeFieldName(_name);

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl

@Override
public BeanPropertyWriter withSerializer(JsonSerializer<Object> ser)
{
  if (getClass() != UnwrappingBeanPropertyWriter.class) {
    throw new IllegalStateException("UnwrappingBeanPropertyWriter sub-class does not override 'withSerializer()'; needs to!");
  }
  // better try to create unwrapping instance
  if (!ser.isUnwrappingSerializer()) {
    ser = ser.unwrappingSerializer();
  }
  return new UnwrappingBeanPropertyWriter(this, ser);
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

@Override
public BeanPropertyWriter withSerializer(JsonSerializer<Object> ser)
{
  if (getClass() != UnwrappingBeanPropertyWriter.class) {
    throw new IllegalStateException("UnwrappingBeanPropertyWriter sub-class does not override 'withSerializer()'; needs to!");
  }
  // better try to create unwrapping instance
  if (!ser.isUnwrappingSerializer()) {
    ser = ser.unwrappingSerializer();
  }
  return new UnwrappingBeanPropertyWriter(this, ser);
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl

@Override
  protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map,
      Class<?> type, SerializerProvider provider) throws JsonMappingException
  {
    JsonSerializer<Object> serializer;
    if (_nonTrivialBaseType != null) {
      JavaType subtype = provider.constructSpecializedType(_nonTrivialBaseType, type);
      serializer = provider.findValueSerializer(subtype, this);
    } else {
      serializer = provider.findValueSerializer(type, this);
    }
    if (!serializer.isUnwrappingSerializer()) {
      serializer = serializer.unwrappingSerializer();
    }
    _dynamicSerializers = _dynamicSerializers.newWith(type, serializer);
    return serializer;
  }
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl

if (!ser.isUnwrappingSerializer()) {
  jgen.writeFieldName(_name);

代码示例来源:origin: ovea-deprecated/jetty-session-redis

@Override
  protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map,
      Class<?> type, SerializerProvider provider) throws JsonMappingException
  {
    JsonSerializer<Object> serializer;
    if (_nonTrivialBaseType != null) {
      JavaType t = _nonTrivialBaseType.forcedNarrowBy(type);
      serializer = provider.findValueSerializer(t, this);
    } else {
      serializer = provider.findValueSerializer(type, this);
    }
    if (!serializer.isUnwrappingSerializer()) {
      serializer = serializer.unwrappingSerializer();
    }
    _dynamicSerializers = _dynamicSerializers.newWith(type, serializer);
    return serializer;
  }
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

if (!ser.isUnwrappingSerializer()) {
  jgen.writeFieldName(_name);

相关文章