Java 类com.google.gson.internal.ObjectConstructor 实例源码

项目:odoo-work    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:odoo-work    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:lams    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:lams    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:odoo-follow-up    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:odoo-follow-up    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:MyJojoXUtils    文件:MapTypeAdapterFactory.java   
@Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:MyJojoXUtils    文件:CollectionTypeAdapterFactory.java   
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:SteamLib    文件:MapTypeAdapterFactory.java   
@Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:SteamLib    文件:CollectionTypeAdapterFactory.java   
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:1797-2017    文件:MapTypeAdapterFactory.java   
@Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:1797-2017    文件:CollectionTypeAdapterFactory.java   
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:1797-2017    文件:MapTypeAdapterFactory.java   
@Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:1797-2017    文件:CollectionTypeAdapterFactory.java   
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:urmusic-desktop    文件:MapTypeAdapterFactory.java   
@Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:urmusic-desktop    文件:CollectionTypeAdapterFactory.java   
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:android-http-lib-based-on-volley    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:android-http-lib-based-on-volley    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:reflect-app    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:reflect-app    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:ti.box    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.getConstructor(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:ti.box    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.getConstructor(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:androidsummary    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.getConstructor(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:androidsummary    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.getConstructor(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:Edge-Node    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:Edge-Node    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:salt-netapi-client    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
    Type type = typeToken.getType();

    Class<? super T> rawType = typeToken.getRawType();
    if (!Collection.class.isAssignableFrom(rawType)) {
        return null;
    }
    Type elementType = $Gson$Types.getCollectionElementType(type, rawType);

    TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
    ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

    @SuppressWarnings({ "unchecked", "rawtypes" })
    TypeAdapter<T> result = new Adapter(elementTypeAdapter, constructor);
    return result;
}
项目:BungeeSigns    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:BungeeSigns    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:multicraft-api    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:multicraft-api    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:StaticMC    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:StaticMC    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:gson    文件:MapTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Map.class.isAssignableFrom(rawType)) {
    return null;
  }

  Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
  Type[] keyAndValueTypes = $Gson$Types.getMapKeyAndValueTypes(type, rawTypeOfSrc);
  TypeAdapter<?> keyAdapter = getKeyAdapter(gson, keyAndValueTypes[0]);
  TypeAdapter<?> valueAdapter = gson.getAdapter(TypeToken.get(keyAndValueTypes[1]));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"})
  // we don't define a type parameter for the key or value types
  TypeAdapter<T> result = new Adapter(gson, keyAndValueTypes[0], keyAdapter,
      keyAndValueTypes[1], valueAdapter, constructor);
  return result;
}
项目:gson    文件:CollectionTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
  Type type = typeToken.getType();

  Class<? super T> rawType = typeToken.getRawType();
  if (!Collection.class.isAssignableFrom(rawType)) {
    return null;
  }

  Type elementType = $Gson$Types.getCollectionElementType(type, rawType);
  TypeAdapter<?> elementTypeAdapter = gson.getAdapter(TypeToken.get(elementType));
  ObjectConstructor<T> constructor = constructorConstructor.get(typeToken);

  @SuppressWarnings({"unchecked", "rawtypes"}) // create() doesn't define a type parameter
  TypeAdapter<T> result = new Adapter(gson, elementType, elementTypeAdapter, constructor);
  return result;
}
项目:odoo-work    文件:MapTypeAdapterFactory.java   
public Adapter(Gson context, Type keyType, TypeAdapter<K> keyTypeAdapter,
    Type valueType, TypeAdapter<V> valueTypeAdapter,
    ObjectConstructor<? extends Map<K, V>> constructor) {
  this.keyTypeAdapter =
    new TypeAdapterRuntimeTypeWrapper<K>(context, keyTypeAdapter, keyType);
  this.valueTypeAdapter =
    new TypeAdapterRuntimeTypeWrapper<V>(context, valueTypeAdapter, valueType);
  this.constructor = constructor;
}
项目:odoo-work    文件:CollectionTypeAdapterFactory.java   
public Adapter(Gson context, Type elementType,
    TypeAdapter<E> elementTypeAdapter,
    ObjectConstructor<? extends Collection<E>> constructor) {
  this.elementTypeAdapter =
      new TypeAdapterRuntimeTypeWrapper<E>(context, elementTypeAdapter, elementType);
  this.constructor = constructor;
}
项目:odoo-work    文件:ReflectiveTypeAdapterFactory.java   
public <T> TypeAdapter<T> create(Gson gson, final TypeToken<T> type) {
  Class<? super T> raw = type.getRawType();

  if (!Object.class.isAssignableFrom(raw)) {
    return null; // it's a primitive!
  }

  ObjectConstructor<T> constructor = constructorConstructor.get(type);
  return new Adapter<T>(constructor, getBoundFields(gson, type, raw));
}
项目:lams    文件:MapTypeAdapterFactory.java   
public Adapter(Gson context, Type keyType, TypeAdapter<K> keyTypeAdapter,
    Type valueType, TypeAdapter<V> valueTypeAdapter,
    ObjectConstructor<? extends Map<K, V>> constructor) {
  this.keyTypeAdapter =
    new TypeAdapterRuntimeTypeWrapper<K>(context, keyTypeAdapter, keyType);
  this.valueTypeAdapter =
    new TypeAdapterRuntimeTypeWrapper<V>(context, valueTypeAdapter, valueType);
  this.constructor = constructor;
}
项目:lams    文件:CollectionTypeAdapterFactory.java   
public Adapter(Gson context, Type elementType,
    TypeAdapter<E> elementTypeAdapter,
    ObjectConstructor<? extends Collection<E>> constructor) {
  this.elementTypeAdapter =
      new TypeAdapterRuntimeTypeWrapper<E>(context, elementTypeAdapter, elementType);
  this.constructor = constructor;
}