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


Java JsonSerializableWithType类代码示例

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


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

示例1: serializeWithType

import org.codehaus.jackson.map.JsonSerializableWithType; //导入依赖的package包/类
public final void serializeWithType(JsonSerializable paramJsonSerializable, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, TypeSerializer paramTypeSerializer)
  throws IOException, JsonGenerationException
{
  if ((paramJsonSerializable instanceof JsonSerializableWithType))
  {
    ((JsonSerializableWithType)paramJsonSerializable).serializeWithType(paramJsonGenerator, paramSerializerProvider, paramTypeSerializer);
    return;
  }
  serialize(paramJsonSerializable, paramJsonGenerator, paramSerializerProvider);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:11,代码来源:StdSerializers.java

示例2: findSerializerByPrimaryType

import org.codehaus.jackson.map.JsonSerializableWithType; //导入依赖的package包/类
public final JsonSerializer<?> findSerializerByPrimaryType(JavaType paramJavaType, SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean)
  throws JsonMappingException
{
  Class localClass = paramJavaType.getRawClass();
  Object localObject;
  if (JsonSerializable.class.isAssignableFrom(localClass))
    if (JsonSerializableWithType.class.isAssignableFrom(localClass))
      localObject = StdSerializers.SerializableWithTypeSerializer.instance;
  do
  {
    return localObject;
    return StdSerializers.SerializableSerializer.instance;
    AnnotatedMethod localAnnotatedMethod = paramBasicBeanDescription.findJsonValueMethod();
    if (localAnnotatedMethod != null)
    {
      JsonSerializer localJsonSerializer = findSerializerFromAnnotation(paramSerializationConfig, localAnnotatedMethod, paramBeanProperty);
      return new JsonValueSerializer(localAnnotatedMethod.getAnnotated(), localJsonSerializer, paramBeanProperty);
    }
    if (InetAddress.class.isAssignableFrom(localClass))
      return InetAddressSerializer.instance;
    if (TimeZone.class.isAssignableFrom(localClass))
      return TimeZoneSerializer.instance;
    localObject = this.optionalHandlers.findSerializer(paramSerializationConfig, paramJavaType);
  }
  while (localObject != null);
  if (Number.class.isAssignableFrom(localClass))
    return StdSerializers.NumberSerializer.instance;
  if (Enum.class.isAssignableFrom(localClass))
    return EnumSerializer.construct(localClass, paramSerializationConfig, paramBasicBeanDescription);
  if (Calendar.class.isAssignableFrom(localClass))
    return StdSerializers.CalendarSerializer.instance;
  if (java.util.Date.class.isAssignableFrom(localClass))
    return StdSerializers.UtilDateSerializer.instance;
  return (JsonSerializer<?>)null;
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:36,代码来源:BasicSerializerFactory.java

示例3: serializeWithType

import org.codehaus.jackson.map.JsonSerializableWithType; //导入依赖的package包/类
public final void serializeWithType(JsonSerializable paramJsonSerializable, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, TypeSerializer paramTypeSerializer)
{
  if ((paramJsonSerializable instanceof JsonSerializableWithType))
  {
    ((JsonSerializableWithType)paramJsonSerializable).serializeWithType(paramJsonGenerator, paramSerializerProvider, paramTypeSerializer);
    return;
  }
  serialize(paramJsonSerializable, paramJsonGenerator, paramSerializerProvider);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:10,代码来源:SerializableSerializer.java

示例4: findSerializerByPrimaryType

import org.codehaus.jackson.map.JsonSerializableWithType; //导入依赖的package包/类
public final JsonSerializer<?> findSerializerByPrimaryType(JavaType paramJavaType, SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean)
{
  Class localClass = paramJavaType.getRawClass();
  Object localObject;
  if (JsonSerializable.class.isAssignableFrom(localClass))
    if (JsonSerializableWithType.class.isAssignableFrom(localClass))
      localObject = SerializableWithTypeSerializer.instance;
  do
  {
    return localObject;
    return SerializableSerializer.instance;
    AnnotatedMethod localAnnotatedMethod = paramBasicBeanDescription.findJsonValueMethod();
    if (localAnnotatedMethod != null)
    {
      Method localMethod = localAnnotatedMethod.getAnnotated();
      if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS))
        ClassUtil.checkAndFixAccess(localMethod);
      return new JsonValueSerializer(localMethod, findSerializerFromAnnotation(paramSerializationConfig, localAnnotatedMethod, paramBeanProperty), paramBeanProperty);
    }
    if (InetAddress.class.isAssignableFrom(localClass))
      return InetAddressSerializer.instance;
    if (TimeZone.class.isAssignableFrom(localClass))
      return TimeZoneSerializer.instance;
    localObject = this.optionalHandlers.findSerializer(paramSerializationConfig, paramJavaType);
  }
  while (localObject != null);
  if (Number.class.isAssignableFrom(localClass))
    return StdSerializers.NumberSerializer.instance;
  if (Enum.class.isAssignableFrom(localClass))
    return EnumSerializer.construct(localClass, paramSerializationConfig, paramBasicBeanDescription);
  if (Calendar.class.isAssignableFrom(localClass))
    return CalendarSerializer.instance;
  if (java.util.Date.class.isAssignableFrom(localClass))
    return DateSerializer.instance;
  return null;
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:37,代码来源:BasicSerializerFactory.java

示例5: serialize

import org.codehaus.jackson.map.JsonSerializableWithType; //导入依赖的package包/类
public void serialize(JsonSerializableWithType paramJsonSerializableWithType, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
  throws IOException, JsonGenerationException
{
  paramJsonSerializableWithType.serialize(paramJsonGenerator, paramSerializerProvider);
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:6,代码来源:StdSerializers.java

示例6: SerializableWithTypeSerializer

import org.codehaus.jackson.map.JsonSerializableWithType; //导入依赖的package包/类
protected SerializableWithTypeSerializer()
{
  super(JsonSerializableWithType.class);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:SerializableWithTypeSerializer.java

示例7: serialize

import org.codehaus.jackson.map.JsonSerializableWithType; //导入依赖的package包/类
public void serialize(JsonSerializableWithType paramJsonSerializableWithType, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
{
  paramJsonSerializableWithType.serialize(paramJsonGenerator, paramSerializerProvider);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:SerializableWithTypeSerializer.java

示例8: serializeWithType

import org.codehaus.jackson.map.JsonSerializableWithType; //导入依赖的package包/类
public final void serializeWithType(JsonSerializableWithType paramJsonSerializableWithType, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, TypeSerializer paramTypeSerializer)
{
  paramJsonSerializableWithType.serializeWithType(paramJsonGenerator, paramSerializerProvider, paramTypeSerializer);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:SerializableWithTypeSerializer.java


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