當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。