Java 类org.codehaus.jackson.map.JsonSerializer 实例源码

项目:12306-android-Decompile    文件:CustomSerializerFactory.java   
protected JsonSerializer<?> _findInterfaceMapping(Class<?> paramClass, ClassKey paramClassKey)
{
  for (Class localClass : paramClass.getInterfaces())
  {
    paramClassKey.reset(localClass);
    JsonSerializer localJsonSerializer = (JsonSerializer)this._interfaceMappings.get(paramClassKey);
    if (localJsonSerializer != null);
    do
    {
      return localJsonSerializer;
      localJsonSerializer = _findInterfaceMapping(localClass, paramClassKey);
    }
    while (localJsonSerializer != null);
  }
  return null;
}
项目:12306-android-Decompile    文件:BasicSerializerFactory.java   
protected JsonSerializer<?> buildCollectionSerializer(SerializationConfig paramSerializationConfig, CollectionType paramCollectionType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer)
{
  Iterator localIterator = customSerializers().iterator();
  while (localIterator.hasNext())
  {
    JsonSerializer localJsonSerializer = ((Serializers)localIterator.next()).findCollectionSerializer(paramSerializationConfig, paramCollectionType, paramBasicBeanDescription, paramBeanProperty, paramTypeSerializer, paramJsonSerializer);
    if (localJsonSerializer != null)
      return localJsonSerializer;
  }
  Class localClass1 = paramCollectionType.getRawClass();
  if (EnumSet.class.isAssignableFrom(localClass1))
    return buildEnumSetSerializer(paramSerializationConfig, paramCollectionType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, paramTypeSerializer, paramJsonSerializer);
  Class localClass2 = paramCollectionType.getContentType().getRawClass();
  if (isIndexedList(localClass1))
  {
    if (localClass2 == String.class)
      return new IndexedStringListSerializer(paramBeanProperty);
    return ContainerSerializers.indexedListSerializer(paramCollectionType.getContentType(), paramBoolean, paramTypeSerializer, paramBeanProperty, paramJsonSerializer);
  }
  if (localClass2 == String.class)
    return new StringCollectionSerializer(paramBeanProperty);
  return ContainerSerializers.collectionSerializer(paramCollectionType.getContentType(), paramBoolean, paramTypeSerializer, paramBeanProperty, paramJsonSerializer);
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public JsonSerializer<Object> findBeanSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty)
  throws JsonMappingException
{
  JsonSerializer localJsonSerializer;
  if (!isPotentialBeanType(paramJavaType.getRawClass()))
    localJsonSerializer = null;
  while (true)
  {
    return localJsonSerializer;
    localJsonSerializer = constructBeanSerializer(paramSerializationConfig, paramBasicBeanDescription, paramBeanProperty);
    if (!this._factoryConfig.hasSerializerModifiers())
      continue;
    Iterator localIterator = this._factoryConfig.serializerModifiers().iterator();
    while (localIterator.hasNext())
      localJsonSerializer = ((BeanSerializerModifier)localIterator.next()).modifySerializer(paramSerializationConfig, paramBasicBeanDescription, localJsonSerializer);
  }
}
项目:12306-android-Decompile    文件:ContainerSerializers.java   
protected AsArraySerializer(Class<?> paramClass, JavaType paramJavaType, boolean paramBoolean, TypeSerializer paramTypeSerializer, BeanProperty paramBeanProperty, JsonSerializer<Object> paramJsonSerializer)
{
  super(false);
  this._elementType = paramJavaType;
  boolean bool1;
  if (!paramBoolean)
  {
    bool1 = false;
    if (paramJavaType != null)
    {
      boolean bool2 = paramJavaType.isFinal();
      bool1 = false;
      if (!bool2);
    }
  }
  else
  {
    bool1 = true;
  }
  this._staticTyping = bool1;
  this._valueTypeSerializer = paramTypeSerializer;
  this._property = paramBeanProperty;
  this._elementSerializer = paramJsonSerializer;
  this._dynamicSerializers = PropertySerializerMap.emptyMap();
}
项目:12306-android-Decompile    文件:MapSerializer.java   
public static MapSerializer construct(String[] paramArrayOfString, JavaType paramJavaType, boolean paramBoolean, TypeSerializer paramTypeSerializer, BeanProperty paramBeanProperty, JsonSerializer<Object> paramJsonSerializer1, JsonSerializer<Object> paramJsonSerializer2)
{
  HashSet localHashSet = toSet(paramArrayOfString);
  JavaType localJavaType2;
  JavaType localJavaType1;
  if (paramJavaType == null)
  {
    localJavaType2 = UNSPECIFIED_TYPE;
    localJavaType1 = localJavaType2;
    if (!paramBoolean)
      if ((localJavaType2 == null) || (!localJavaType2.isFinal()))
        break label75;
  }
  label75: for (paramBoolean = true; ; paramBoolean = false)
  {
    return new MapSerializer(localHashSet, localJavaType1, localJavaType2, paramBoolean, paramTypeSerializer, paramJsonSerializer1, paramJsonSerializer2, paramBeanProperty);
    localJavaType1 = paramJavaType.getKeyType();
    localJavaType2 = paramJavaType.getContentType();
    break;
  }
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
protected JsonSerializer<Object> _findExplicitUntypedSerializer(Class<?> paramClass, BeanProperty paramBeanProperty)
{
  JsonSerializer localJsonSerializer1 = this._knownSerializers.untypedValueSerializer(paramClass);
  if (localJsonSerializer1 != null)
    return localJsonSerializer1;
  JsonSerializer localJsonSerializer2 = this._serializerCache.untypedValueSerializer(paramClass);
  if (localJsonSerializer2 != null)
    return localJsonSerializer2;
  try
  {
    JsonSerializer localJsonSerializer3 = _createAndCacheUntypedSerializer(paramClass, paramBeanProperty);
    return localJsonSerializer3;
  }
  catch (Exception localException)
  {
  }
  return null;
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public JsonSerializer<Object> findTypedValueSerializer(Class<?> paramClass, boolean paramBoolean, BeanProperty paramBeanProperty)
  throws JsonMappingException
{
  JsonSerializer localJsonSerializer1 = this._knownSerializers.typedValueSerializer(paramClass);
  if (localJsonSerializer1 != null)
    return localJsonSerializer1;
  JsonSerializer localJsonSerializer2 = this._serializerCache.typedValueSerializer(paramClass);
  if (localJsonSerializer2 != null)
    return localJsonSerializer2;
  Object localObject = findValueSerializer(paramClass, paramBeanProperty);
  TypeSerializer localTypeSerializer = this._serializerFactory.createTypeSerializer(this._config, this._config.constructType(paramClass), paramBeanProperty);
  if (localTypeSerializer != null)
    localObject = new WrappedSerializer(localTypeSerializer, (JsonSerializer)localObject);
  if (paramBoolean)
    this._serializerCache.addTypedSerializer(paramClass, (JsonSerializer)localObject);
  return (JsonSerializer<Object>)localObject;
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public JsonSerializer<Object> findTypedValueSerializer(JavaType paramJavaType, boolean paramBoolean, BeanProperty paramBeanProperty)
  throws JsonMappingException
{
  JsonSerializer localJsonSerializer1 = this._knownSerializers.typedValueSerializer(paramJavaType);
  if (localJsonSerializer1 != null)
    return localJsonSerializer1;
  JsonSerializer localJsonSerializer2 = this._serializerCache.typedValueSerializer(paramJavaType);
  if (localJsonSerializer2 != null)
    return localJsonSerializer2;
  Object localObject = findValueSerializer(paramJavaType, paramBeanProperty);
  TypeSerializer localTypeSerializer = this._serializerFactory.createTypeSerializer(this._config, paramJavaType, paramBeanProperty);
  if (localTypeSerializer != null)
    localObject = new WrappedSerializer(localTypeSerializer, (JsonSerializer)localObject);
  if (paramBoolean)
    this._serializerCache.addTypedSerializer(paramJavaType, (JsonSerializer)localObject);
  return (JsonSerializer<Object>)localObject;
}
项目:12306-android-Decompile    文件:StdSerializerProvider.java   
public JsonSerializer<Object> findValueSerializer(Class<?> paramClass, BeanProperty paramBeanProperty)
  throws JsonMappingException
{
  JsonSerializer localJsonSerializer = this._knownSerializers.untypedValueSerializer(paramClass);
  if (localJsonSerializer == null)
  {
    localJsonSerializer = this._serializerCache.untypedValueSerializer(paramClass);
    if (localJsonSerializer == null)
    {
      localJsonSerializer = this._serializerCache.untypedValueSerializer(this._config.constructType(paramClass));
      if (localJsonSerializer == null)
      {
        localJsonSerializer = _createAndCacheUntypedSerializer(paramClass, paramBeanProperty);
        if (localJsonSerializer == null)
          return getUnknownTypeSerializer(paramClass);
      }
    }
  }
  if ((localJsonSerializer instanceof ContextualSerializer))
    return ((ContextualSerializer)localJsonSerializer).createContextual(this._config, paramBeanProperty);
  return localJsonSerializer;
}
项目:12306-android-Decompile    文件:SerializerCache.java   
public void addAndResolveNonTypedSerializer(Class<?> paramClass, JsonSerializer<Object> paramJsonSerializer, SerializerProvider paramSerializerProvider)
  throws JsonMappingException
{
  monitorenter;
  try
  {
    if (this._sharedMap.put(new TypeKey(paramClass, false), paramJsonSerializer) == null)
      this._readOnlyMap = null;
    if ((paramJsonSerializer instanceof ResolvableSerializer))
      ((ResolvableSerializer)paramJsonSerializer).resolve(paramSerializerProvider);
    return;
  }
  finally
  {
    monitorexit;
  }
  throw localObject;
}
项目:12306-android-Decompile    文件:SerializerCache.java   
public void addAndResolveNonTypedSerializer(JavaType paramJavaType, JsonSerializer<Object> paramJsonSerializer, SerializerProvider paramSerializerProvider)
  throws JsonMappingException
{
  monitorenter;
  try
  {
    if (this._sharedMap.put(new TypeKey(paramJavaType, false), paramJsonSerializer) == null)
      this._readOnlyMap = null;
    if ((paramJsonSerializer instanceof ResolvableSerializer))
      ((ResolvableSerializer)paramJsonSerializer).resolve(paramSerializerProvider);
    return;
  }
  finally
  {
    monitorexit;
  }
  throw localObject;
}
项目:12306-android-Decompile    文件:BeanPropertyWriter.java   
public BeanPropertyWriter(AnnotatedMember paramAnnotatedMember, Annotations paramAnnotations, SerializedString paramSerializedString, JavaType paramJavaType1, JsonSerializer<Object> paramJsonSerializer, TypeSerializer paramTypeSerializer, JavaType paramJavaType2, Method paramMethod, Field paramField, boolean paramBoolean, Object paramObject)
{
  this._member = paramAnnotatedMember;
  this._contextAnnotations = paramAnnotations;
  this._name = paramSerializedString;
  this._declaredType = paramJavaType1;
  this._serializer = paramJsonSerializer;
  if (paramJsonSerializer == null);
  for (PropertySerializerMap localPropertySerializerMap = PropertySerializerMap.emptyMap(); ; localPropertySerializerMap = null)
  {
    this._dynamicSerializers = localPropertySerializerMap;
    this._typeSerializer = paramTypeSerializer;
    this._cfgSerializationType = paramJavaType2;
    this._accessorMethod = paramMethod;
    this._field = paramField;
    this._suppressNulls = paramBoolean;
    this._suppressableValue = paramObject;
    return;
  }
}
项目:12306-android-Decompile    文件:BasicSerializerFactory.java   
public final JsonSerializer<?> findSerializerByLookup(JavaType paramJavaType, SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean)
{
  String str = paramJavaType.getRawClass().getName();
  JsonSerializer localJsonSerializer1 = (JsonSerializer)_concrete.get(str);
  if (localJsonSerializer1 != null)
    return localJsonSerializer1;
  Class localClass = (Class)_concreteLazy.get(str);
  if (localClass != null)
    try
    {
      JsonSerializer localJsonSerializer2 = (JsonSerializer)localClass.newInstance();
      return localJsonSerializer2;
    }
    catch (Exception localException)
    {
      throw new IllegalStateException("Failed to instantiate standard serializer (of type " + localClass.getName() + "): " + localException.getMessage(), localException);
    }
  return null;
}
项目:12306-android-Decompile    文件:EnumMapSerializer.java   
public EnumMapSerializer(JavaType paramJavaType, boolean paramBoolean, EnumValues paramEnumValues, TypeSerializer paramTypeSerializer, BeanProperty paramBeanProperty, JsonSerializer<Object> paramJsonSerializer)
{
  super(EnumMap.class, false);
  boolean bool1;
  if (!paramBoolean)
  {
    bool1 = false;
    if (paramJavaType != null)
    {
      boolean bool2 = paramJavaType.isFinal();
      bool1 = false;
      if (!bool2);
    }
  }
  else
  {
    bool1 = true;
  }
  this._staticTyping = bool1;
  this._valueType = paramJavaType;
  this._keyEnums = paramEnumValues;
  this._valueTypeSerializer = paramTypeSerializer;
  this._property = paramBeanProperty;
  this._valueSerializer = paramJsonSerializer;
}
项目:12306-android-Decompile    文件:JsonSerializerMap.java   
public JsonSerializer<Object> find(SerializerCache.TypeKey paramTypeKey)
{
  int i = paramTypeKey.hashCode() & -1 + this._buckets.length;
  Bucket localBucket = this._buckets[i];
  if (localBucket == null)
    return null;
  if (paramTypeKey.equals(localBucket.key))
    return localBucket.value;
  do
  {
    localBucket = localBucket.next;
    if (localBucket == null)
      break;
  }
  while (!paramTypeKey.equals(localBucket.key));
  return localBucket.value;
}
项目:playground    文件:BasicObjectMapperProvider.java   
/** Add Joda-Time serializers to a module. */
@SuppressWarnings({
        "unchecked",
        "rawtypes"
})
private static void addJodaSerializers(final SimpleModule module) {

    for (final Entry<Class<?>, JsonSerializer<?>> serializer : new JodaSerializers().provide()) {
        module.addSerializer((Class) serializer.getKey(), serializer.getValue());
    }
    module.addSerializer(Duration.class, DurationSerializer.create());
    module.addSerializer(Instant.class, InstantSerializer.create());
    module.addSerializer(Interval.class, IntervalSerializer.create());
    module.addSerializer(LocalDate.class, LocalDateSerializer.create());
}
项目:typescript-service-generator    文件:ServiceEmitter.java   
private Set<Class<?>> filterInputClasses(Set<Class<?>> referencedClasses) {
    Set<Class<?>> typesToUse = Sets.newHashSet();
    for (Class<?> beanClass : referencedClasses) {
        if (beanClass.isEnum()) {
            typesToUse.add(beanClass);
            continue;
        }
        if (beanClass.equals(void.class)) {
            continue;
        }
        if (beanClass instanceof Class && beanClass.isEnum()) {
            typesToUse.add(beanClass);
            continue;
        }
        if (beanClass == URI.class) {
            continue;
        }

        // Classes directly passed in to typescript-generator need to be directly serializable, so filter out the ones that serializers
        // exist for.
        SerializationConfig serializationConfig = OBJECT_MAPPER.getSerializationConfig();
        final JavaType simpleType = OBJECT_MAPPER.constructType(beanClass);
        try {
            final JsonSerializer<?> jsonSerializer = BeanSerializerFactory.instance.createSerializer(serializationConfig, simpleType, null);
            if (jsonSerializer == null || jsonSerializer instanceof BeanSerializer) {
                typesToUse.add(beanClass);
            }
        } catch(Exception e) {

        }
    }
    return typesToUse;
}
项目:bscl    文件:StdEscapeHTMLSerializerProvider.java   
@SuppressWarnings("unchecked")
public StdEscapeHTMLSerializerProvider(SerializationConfig serializationConfig) throws JsonMappingException {
    super(serializationConfig, new StdSerializerProvider(), BeanSerializerFactory.instance);
    JsonSerializer stringEscapeHTMLSerializer = new StringEscapeHTMLSerializer();
    _serializerCache.addAndResolveNonTypedSerializer(String.class, stringEscapeHTMLSerializer, this);
    JavaType javaType = TypeFactory.fromCanonical(String.class.getName());
    _serializerCache.addAndResolveNonTypedSerializer(javaType, stringEscapeHTMLSerializer, this);

}
项目:12306-android-Decompile    文件:BasicSerializerFactory.java   
public JsonSerializer<?> buildContainerSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean)
{
  TypeSerializer localTypeSerializer = createTypeSerializer(paramSerializationConfig, paramJavaType.getContentType(), paramBeanProperty);
  if (localTypeSerializer != null)
    paramBoolean = false;
  JsonSerializer localJsonSerializer1;
  while (true)
  {
    localJsonSerializer1 = findContentSerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty);
    if (!paramJavaType.isMapLikeType())
      break;
    MapLikeType localMapLikeType = (MapLikeType)paramJavaType;
    JsonSerializer localJsonSerializer2 = findKeySerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty);
    if (localMapLikeType.isTrueMapType())
    {
      return buildMapSerializer(paramSerializationConfig, (MapType)localMapLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localJsonSerializer2, localTypeSerializer, localJsonSerializer1);
      if (paramBoolean)
        continue;
      paramBoolean = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, localTypeSerializer, paramBeanProperty);
      continue;
    }
    return buildMapLikeSerializer(paramSerializationConfig, localMapLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localJsonSerializer2, localTypeSerializer, localJsonSerializer1);
  }
  if (paramJavaType.isCollectionLikeType())
  {
    CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType;
    if (localCollectionLikeType.isTrueCollectionType())
      return buildCollectionSerializer(paramSerializationConfig, (CollectionType)localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1);
    return buildCollectionLikeSerializer(paramSerializationConfig, localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1);
  }
  if (paramJavaType.isArrayType())
    return buildArraySerializer(paramSerializationConfig, (ArrayType)paramJavaType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1);
  return null;
}
项目:community-edition-old    文件:UniqueIdPropertyWriter.java   
@Override
public void serializeAsField(Object bean, JsonGenerator jgen, SerializerProvider prov)
            throws Exception
{
    // _name is final so we have to do a little bit of trickery to change the field name.
    Object value = get(bean);
    // Null handling is bit different, check that first
    if (value == null) {
        if (!_suppressNulls) {
            jgen.writeFieldName(_name);
            prov.defaultSerializeNull(jgen);
        }
        return;
    }
    // For non-nulls, first: simple check for direct cycles
    if (value == bean) {
        _reportSelfReference(bean);
    }
    if (_suppressableValue != null && _suppressableValue.equals(value)) {
        return;
    }

    JsonSerializer<Object> ser = _serializer;
    if (ser == null) {
        Class<?> cls = value.getClass();
        PropertySerializerMap map = _dynamicSerializers;
        ser = map.serializerFor(cls);
        if (ser == null) {
            ser = _findAndAddDynamic(map, cls, prov);
        }
    }
    jgen.writeFieldName(UniqueId.UNIQUE_NAME);
    if (_typeSerializer == null) {
        ser.serialize(value, jgen, prov);
    } else {
        ser.serializeWithType(value, jgen, prov, _typeSerializer);
    }

}
项目:community-edition-old    文件:RestJsonModule.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void afterPropertiesSet() throws Exception
{
    if (jsonSerializers != null) 
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("Setting up Json Module serializers");
        }
        for (JsonSerializer aSerializer : jsonSerializers)
        {
            addSerializer(aSerializer);
        }
    }
    if (jsonDeserializers != null) 
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("Setting up Json Module deserializers");
        }
        for (Entry<String, JsonDeserializer> aDeserializer : jsonDeserializers.entrySet())
        {
            Class theDeserializer = Class.forName(aDeserializer.getKey());
            addDeserializer(theDeserializer, aDeserializer.getValue());
        }
    }
}
项目:class-guard    文件:MappingJacksonJsonViewTests.java   
@Override
public JsonSerializer<Object> createSerializer(SerializationConfig config, JavaType baseType, BeanProperty property) {
    if (baseType.getRawClass() == TestBeanSimple.class) {
        return new TestBeanSimpleSerializer();
    }
    else {
        return super.createSerializer(config, baseType, property);
    }
}
项目:12306-android-Decompile    文件:ArraySerializers.java   
public void resolve(SerializerProvider paramSerializerProvider)
  throws JsonMappingException
{
  JsonSerializer localJsonSerializer = paramSerializerProvider.findValueSerializer(String.class, this._property);
  if ((localJsonSerializer != null) && (localJsonSerializer.getClass().getAnnotation(JacksonStdImpl.class) == null))
    this._elementSerializer = localJsonSerializer;
}
项目:12306-android-Decompile    文件:CustomSerializerFactory.java   
public <T> void addGenericMapping(Class<? extends T> paramClass, JsonSerializer<T> paramJsonSerializer)
{
  ClassKey localClassKey = new ClassKey(paramClass);
  if (paramClass.isInterface())
  {
    if (this._interfaceMappings == null)
      this._interfaceMappings = new HashMap();
    this._interfaceMappings.put(localClassKey, paramJsonSerializer);
    return;
  }
  if (this._transitiveClassMappings == null)
    this._transitiveClassMappings = new HashMap();
  this._transitiveClassMappings.put(localClassKey, paramJsonSerializer);
}
项目:12306-android-Decompile    文件:CustomSerializerFactory.java   
public <T> void addSpecificMapping(Class<? extends T> paramClass, JsonSerializer<T> paramJsonSerializer)
{
  ClassKey localClassKey = new ClassKey(paramClass);
  if (paramClass.isInterface())
    throw new IllegalArgumentException("Can not add specific mapping for an interface (" + paramClass.getName() + ")");
  if (Modifier.isAbstract(paramClass.getModifiers()))
    throw new IllegalArgumentException("Can not add specific mapping for an abstract class (" + paramClass.getName() + ")");
  if (this._directClassMappings == null)
    this._directClassMappings = new HashMap();
  this._directClassMappings.put(localClassKey, paramJsonSerializer);
}
项目:12306-android-Decompile    文件:CustomSerializerFactory.java   
public JsonSerializer<Object> createSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty)
  throws JsonMappingException
{
  JsonSerializer localJsonSerializer = findCustomSerializer(paramJavaType.getRawClass(), paramSerializationConfig);
  if (localJsonSerializer != null)
    return localJsonSerializer;
  return super.createSerializer(paramSerializationConfig, paramJavaType, paramBeanProperty);
}
项目:12306-android-Decompile    文件:JsonValueSerializer.java   
public JsonValueSerializer(Method paramMethod, JsonSerializer<Object> paramJsonSerializer, BeanProperty paramBeanProperty)
{
  super(Object.class);
  this._accessorMethod = paramMethod;
  this._valueSerializer = paramJsonSerializer;
  this._property = paramBeanProperty;
}
项目:12306-android-Decompile    文件:JsonValueSerializer.java   
protected boolean isNaturalTypeWithStdHandling(JavaType paramJavaType, JsonSerializer<?> paramJsonSerializer)
{
  Class localClass = paramJavaType.getRawClass();
  if (paramJavaType.isPrimitive())
    if ((localClass == Integer.TYPE) || (localClass == Boolean.TYPE) || (localClass == Double.TYPE))
      break label59;
  label59: 
  do
    do
      return false;
    while ((localClass != String.class) && (localClass != Integer.class) && (localClass != Boolean.class) && (localClass != Double.class));
  while (paramJsonSerializer.getClass().getAnnotation(JacksonStdImpl.class) == null);
  return true;
}
项目:12306-android-Decompile    文件:JsonValueSerializer.java   
public void serialize(Object paramObject, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
  throws IOException, JsonGenerationException
{
  Object localObject1;
  try
  {
    Object localObject2 = this._accessorMethod.invoke(paramObject, new Object[0]);
    if (localObject2 == null)
    {
      paramSerializerProvider.defaultSerializeNull(paramJsonGenerator);
      return;
    }
    JsonSerializer localJsonSerializer = this._valueSerializer;
    if (localJsonSerializer == null)
      localJsonSerializer = paramSerializerProvider.findTypedValueSerializer(localObject2.getClass(), true, this._property);
    localJsonSerializer.serialize(localObject2, paramJsonGenerator, paramSerializerProvider);
    return;
  }
  catch (IOException localIOException)
  {
    throw localIOException;
  }
  catch (Exception localException)
  {
    for (localObject1 = localException; ((localObject1 instanceof InvocationTargetException)) && (((Throwable)localObject1).getCause() != null); localObject1 = ((Throwable)localObject1).getCause());
    if ((localObject1 instanceof Error))
      throw ((Error)localObject1);
  }
  throw JsonMappingException.wrapWithPath((Throwable)localObject1, paramObject, this._accessorMethod.getName() + "()");
}
项目:12306-android-Decompile    文件:StringCollectionSerializer.java   
public void resolve(SerializerProvider paramSerializerProvider)
  throws JsonMappingException
{
  JsonSerializer localJsonSerializer = paramSerializerProvider.findValueSerializer(String.class, this._property);
  if (!isDefaultSerializer(localJsonSerializer))
    this._serializer = localJsonSerializer;
}
项目:12306-android-Decompile    文件:BeanSerializerFactory.java   
public JsonSerializer<Object> createSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty)
  throws JsonMappingException
{
  BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramSerializationConfig.introspect(paramJavaType);
  JsonSerializer localJsonSerializer1 = findSerializerFromAnnotation(paramSerializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
  if (localJsonSerializer1 != null)
    return localJsonSerializer1;
  JavaType localJavaType = modifyTypeByAnnotation(paramSerializationConfig, localBasicBeanDescription.getClassInfo(), paramJavaType);
  if (localJavaType != paramJavaType);
  for (boolean bool = true; paramJavaType.isContainerType(); bool = false)
    return buildContainerSerializer(paramSerializationConfig, localJavaType, localBasicBeanDescription, paramBeanProperty, bool);
  Iterator localIterator = this._factoryConfig.serializers().iterator();
  while (localIterator.hasNext())
  {
    JsonSerializer localJsonSerializer5 = ((Serializers)localIterator.next()).findSerializer(paramSerializationConfig, localJavaType, localBasicBeanDescription, paramBeanProperty);
    if (localJsonSerializer5 != null)
      return localJsonSerializer5;
  }
  JsonSerializer localJsonSerializer2 = findSerializerByLookup(localJavaType, paramSerializationConfig, localBasicBeanDescription, paramBeanProperty, bool);
  if (localJsonSerializer2 != null)
    return localJsonSerializer2;
  JsonSerializer localJsonSerializer3 = findSerializerByPrimaryType(localJavaType, paramSerializationConfig, localBasicBeanDescription, paramBeanProperty, bool);
  if (localJsonSerializer3 != null)
    return localJsonSerializer3;
  JsonSerializer localJsonSerializer4 = findBeanSerializer(paramSerializationConfig, localJavaType, localBasicBeanDescription, paramBeanProperty);
  if (localJsonSerializer4 == null)
    localJsonSerializer4 = super.findSerializerByAddonType(paramSerializationConfig, localJavaType, localBasicBeanDescription, paramBeanProperty, bool);
  return localJsonSerializer4;
}
项目:12306-android-Decompile    文件:PropertySerializerMap.java   
public JsonSerializer<Object> serializerFor(Class<?> paramClass)
{
  int i = 0;
  int j = this._entries.length;
  while (i < j)
  {
    PropertySerializerMap.TypeAndSerializer localTypeAndSerializer = this._entries[i];
    if (localTypeAndSerializer.type == paramClass)
      return localTypeAndSerializer.serializer;
    i++;
  }
  return null;
}
项目:12306-android-Decompile    文件:ContainerSerializers.java   
protected final JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap paramPropertySerializerMap, Class<?> paramClass, SerializerProvider paramSerializerProvider)
  throws JsonMappingException
{
  PropertySerializerMap.SerializerAndMapResult localSerializerAndMapResult = paramPropertySerializerMap.findAndAddSerializer(paramClass, paramSerializerProvider, this._property);
  if (paramPropertySerializerMap != localSerializerAndMapResult.map)
    this._dynamicSerializers = localSerializerAndMapResult.map;
  return localSerializerAndMapResult.serializer;
}
项目:12306-android-Decompile    文件:ContainerSerializers.java   
public JsonNode getSchema(SerializerProvider paramSerializerProvider, Type paramType)
  throws JsonMappingException
{
  ObjectNode localObjectNode = createSchemaNode("array", true);
  JavaType localJavaType = null;
  if (paramType != null)
  {
    localJavaType = paramSerializerProvider.constructType(paramType).getContentType();
    if ((localJavaType == null) && ((paramType instanceof ParameterizedType)))
    {
      Type[] arrayOfType = ((ParameterizedType)paramType).getActualTypeArguments();
      if (arrayOfType.length == 1)
        localJavaType = paramSerializerProvider.constructType(arrayOfType[0]);
    }
  }
  if ((localJavaType == null) && (this._elementType != null))
    localJavaType = this._elementType;
  if (localJavaType != null)
  {
    Class localClass = localJavaType.getRawClass();
    JsonNode localJsonNode = null;
    if (localClass != Object.class)
    {
      JsonSerializer localJsonSerializer = paramSerializerProvider.findValueSerializer(localJavaType, this._property);
      boolean bool = localJsonSerializer instanceof SchemaAware;
      localJsonNode = null;
      if (bool)
        localJsonNode = ((SchemaAware)localJsonSerializer).getSchema(paramSerializerProvider, null);
    }
    if (localJsonNode == null)
      localJsonNode = JsonSchema.getDefaultSchemaNode();
    localObjectNode.put("items", localJsonNode);
  }
  return localObjectNode;
}
项目:12306-android-Decompile    文件:ContainerSerializers.java   
public void serializeContentsUsing(Collection<?> paramCollection, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, JsonSerializer<Object> paramJsonSerializer)
  throws IOException, JsonGenerationException
{
  Iterator localIterator = paramCollection.iterator();
  TypeSerializer localTypeSerializer;
  int i;
  if (localIterator.hasNext())
  {
    localTypeSerializer = this._valueTypeSerializer;
    i = 0;
  }
  while (true)
  {
    Object localObject = localIterator.next();
    if (localObject == null);
    try
    {
      paramSerializerProvider.defaultSerializeNull(paramJsonGenerator);
      while (true)
      {
        i++;
        if (localIterator.hasNext())
          break;
        return;
        if (localTypeSerializer != null)
          break label92;
        paramJsonSerializer.serialize(localObject, paramJsonGenerator, paramSerializerProvider);
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        wrapAndThrow(paramSerializerProvider, localException, paramCollection, i);
        continue;
        label92: paramJsonSerializer.serializeWithType(localObject, paramJsonGenerator, paramSerializerProvider, localTypeSerializer);
      }
    }
  }
}
项目:12306-android-Decompile    文件:ContainerSerializers.java   
public void serializeContents(EnumSet<? extends Enum<?>> paramEnumSet, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
  throws IOException, JsonGenerationException
{
  JsonSerializer localJsonSerializer = this._elementSerializer;
  Iterator localIterator = paramEnumSet.iterator();
  while (localIterator.hasNext())
  {
    Enum localEnum = (Enum)localIterator.next();
    if (localJsonSerializer == null)
      localJsonSerializer = paramSerializerProvider.findValueSerializer(localEnum.getDeclaringClass(), this._property);
    localJsonSerializer.serialize(localEnum, paramJsonGenerator, paramSerializerProvider);
  }
}
项目:12306-android-Decompile    文件:BasicSerializerFactory.java   
public final JsonSerializer<?> findSerializerByAddonType(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean)
  throws JsonMappingException
{
  Class localClass = paramJavaType.getRawClass();
  if (Iterator.class.isAssignableFrom(localClass))
    return buildIteratorSerializer(paramSerializationConfig, paramJavaType, paramBasicBeanDescription, paramBeanProperty, paramBoolean);
  if (Iterable.class.isAssignableFrom(localClass))
    return buildIterableSerializer(paramSerializationConfig, paramJavaType, paramBasicBeanDescription, paramBeanProperty, paramBoolean);
  if (CharSequence.class.isAssignableFrom(localClass))
    return ToStringSerializer.instance;
  return null;
}
项目:12306-android-Decompile    文件:PropertySerializerMap.java   
public Double(Class<?> paramClass1, JsonSerializer<Object> paramJsonSerializer1, Class<?> paramClass2, JsonSerializer<Object> paramJsonSerializer2)
{
  this._type1 = paramClass1;
  this._serializer1 = paramJsonSerializer1;
  this._type2 = paramClass2;
  this._serializer2 = paramJsonSerializer2;
}
项目:12306-android-Decompile    文件:ContainerSerializers.java   
public void serializeContents(Iterator<?> paramIterator, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
  throws IOException, JsonGenerationException
{
  TypeSerializer localTypeSerializer;
  Object localObject1;
  Object localObject2;
  if (paramIterator.hasNext())
  {
    localTypeSerializer = this._valueTypeSerializer;
    localObject1 = null;
    localObject2 = null;
  }
  while (true)
  {
    Object localObject3 = paramIterator.next();
    if (localObject3 == null)
      paramSerializerProvider.defaultSerializeNull(paramJsonGenerator);
    while (!paramIterator.hasNext())
    {
      return;
      Class localClass = localObject3.getClass();
      Object localObject4;
      if (localClass == localObject2)
        localObject4 = localObject1;
      while (true)
      {
        if (localTypeSerializer != null)
          break label107;
        ((JsonSerializer)localObject4).serialize(localObject3, paramJsonGenerator, paramSerializerProvider);
        break;
        localObject4 = paramSerializerProvider.findValueSerializer(localClass, this._property);
        localObject1 = localObject4;
        localObject2 = localClass;
      }
      label107: ((JsonSerializer)localObject4).serializeWithType(localObject3, paramJsonGenerator, paramSerializerProvider, localTypeSerializer);
    }
  }
}
项目:12306-android-Decompile    文件:JacksonAnnotationIntrospector.java   
public Object findSerializer(Annotated paramAnnotated, BeanProperty paramBeanProperty)
{
  JsonSerialize localJsonSerialize = (JsonSerialize)paramAnnotated.getAnnotation(JsonSerialize.class);
  if (localJsonSerialize != null)
  {
    Class localClass = localJsonSerialize.using();
    if (localClass != JsonSerializer.None.class)
      return localClass;
  }
  JsonRawValue localJsonRawValue = (JsonRawValue)paramAnnotated.getAnnotation(JsonRawValue.class);
  if ((localJsonRawValue != null) && (localJsonRawValue.value()))
    return new RawSerializer(paramAnnotated.getRawType());
  return null;
}