Java 类android.os.Parcelable.Creator 实例源码

项目:GitHub    文件:ParcelableHelper.java   
public void addCreator(JDefinedClass jclass) {
    JClass creatorType = jclass.owner().ref(Creator.class).narrow(jclass); 
    JDefinedClass creatorClass = jclass.owner().anonymousClass(creatorType);

    addCreateFromParcel(jclass, creatorClass);
    addNewArray(jclass, creatorClass);

    JFieldVar creatorField = jclass.field(JMod.PUBLIC | JMod.STATIC | JMod.FINAL, creatorType, "CREATOR");
    creatorField.init(JExpr._new(creatorClass));
}
项目:FMTech    文件:zza.java   
public static <T extends Parcelable> T zza(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i = zza(paramParcel, paramInt);
  int j = paramParcel.dataPosition();
  if (i == 0) {
    return null;
  }
  Parcelable localParcelable = (Parcelable)paramCreator.createFromParcel(paramParcel);
  paramParcel.setDataPosition(i + j);
  return localParcelable;
}
项目:FMTech    文件:zza.java   
public static <T> T[] zzb(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i = zza(paramParcel, paramInt);
  int j = paramParcel.dataPosition();
  if (i == 0) {
    return null;
  }
  Object[] arrayOfObject = paramParcel.createTypedArray(paramCreator);
  paramParcel.setDataPosition(i + j);
  return arrayOfObject;
}
项目:FMTech    文件:zza.java   
public static <T> ArrayList<T> zzc(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i = zza(paramParcel, paramInt);
  int j = paramParcel.dataPosition();
  if (i == 0) {
    return null;
  }
  ArrayList localArrayList = paramParcel.createTypedArrayList(paramCreator);
  paramParcel.setDataPosition(i + j);
  return localArrayList;
}
项目:FMTech    文件:ParcelableCompat.java   
public static <T> Parcelable.Creator<T> newCreator(ParcelableCompatCreatorCallbacks<T> paramParcelableCompatCreatorCallbacks)
{
  if (Build.VERSION.SDK_INT >= 13) {
    return new ParcelableCompatCreatorHoneycombMR2(paramParcelableCompatCreatorCallbacks);
  }
  return new CompatCreator(paramParcelableCompatCreatorCallbacks);
}
项目:FMTech    文件:efj.java   
public static <T extends Parcelable> T a(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i1 = a(paramParcel, paramInt);
  int i2 = paramParcel.dataPosition();
  if (i1 == 0) {
    return null;
  }
  Parcelable localParcelable = (Parcelable)paramCreator.createFromParcel(paramParcel);
  paramParcel.setDataPosition(i1 + i2);
  return localParcelable;
}
项目:FMTech    文件:efj.java   
public static <T extends SafeParcelable> T a(Intent paramIntent, String paramString, Parcelable.Creator<T> paramCreator)
{
  byte[] arrayOfByte = paramIntent.getByteArrayExtra(paramString);
  if (arrayOfByte == null) {
    return null;
  }
  a(paramCreator);
  Parcel localParcel = Parcel.obtain();
  localParcel.unmarshall(arrayOfByte, 0, arrayOfByte.length);
  localParcel.setDataPosition(0);
  SafeParcelable localSafeParcelable = (SafeParcelable)paramCreator.createFromParcel(localParcel);
  localParcel.recycle();
  return localSafeParcelable;
}
项目:FMTech    文件:efj.java   
public static <T> T[] b(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i1 = a(paramParcel, paramInt);
  int i2 = paramParcel.dataPosition();
  if (i1 == 0) {
    return null;
  }
  Object[] arrayOfObject = paramParcel.createTypedArray(paramCreator);
  paramParcel.setDataPosition(i1 + i2);
  return arrayOfObject;
}
项目:FMTech    文件:efj.java   
public static <T> ArrayList<T> c(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i1 = a(paramParcel, paramInt);
  int i2 = paramParcel.dataPosition();
  if (i1 == 0) {
    return null;
  }
  ArrayList localArrayList = paramParcel.createTypedArrayList(paramCreator);
  paramParcel.setDataPosition(i1 + i2);
  return localArrayList;
}
项目:postman    文件:Postman.java   
private static <T> Parcelable.Creator<T> newCreator(final Class<T> clazz) {
    return new Parcelable.Creator<T>() {
        @Override
        public T createFromParcel(Parcel source) {
            return readFromParcel(clazz, source);
        }

        @Override
        public T[] newArray(int size) {
            return Postman.newArray(clazz, size);
        }
    };
}
项目:QuizUpWinner    文件:a.java   
public static <T extends Parcelable> T a(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i = a(paramParcel, paramInt);
  int j = paramParcel.dataPosition();
  if (i == 0)
    return null;
  Parcelable localParcelable = (Parcelable)paramCreator.createFromParcel(paramParcel);
  paramParcel.setDataPosition(j + i);
  return localParcelable;
}
项目:QuizUpWinner    文件:a.java   
public static <T> T[] b(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i = a(paramParcel, paramInt);
  int j = paramParcel.dataPosition();
  if (i == 0)
    return null;
  Object[] arrayOfObject = paramParcel.createTypedArray(paramCreator);
  paramParcel.setDataPosition(j + i);
  return arrayOfObject;
}
项目:QuizUpWinner    文件:a.java   
public static <T> ArrayList<T> c(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i = a(paramParcel, paramInt);
  int j = paramParcel.dataPosition();
  if (i == 0)
    return null;
  ArrayList localArrayList = paramParcel.createTypedArrayList(paramCreator);
  paramParcel.setDataPosition(j + i);
  return localArrayList;
}
项目:ingress-indonesia-dev    文件:b.java   
public static <T extends Parcelable> T a(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i = a(paramParcel, paramInt);
  int j = paramParcel.dataPosition();
  if (i == 0)
    return null;
  Parcelable localParcelable = (Parcelable)paramCreator.createFromParcel(paramParcel);
  paramParcel.setDataPosition(i + j);
  return localParcelable;
}
项目:ingress-indonesia-dev    文件:b.java   
public static <T> ArrayList<T> b(Parcel paramParcel, int paramInt, Parcelable.Creator<T> paramCreator)
{
  int i = a(paramParcel, paramInt);
  int j = paramParcel.dataPosition();
  if (i == 0)
    return null;
  ArrayList localArrayList = paramParcel.createTypedArrayList(paramCreator);
  paramParcel.setDataPosition(i + j);
  return localArrayList;
}
项目:letv    文件:ParcelableCompat.java   
public static <T> Creator<T> newCreator(ParcelableCompatCreatorCallbacks<T> callbacks) {
    if (VERSION.SDK_INT >= 13) {
        return ParcelableCompatCreatorHoneycombMR2Stub.instantiate(callbacks);
    }
    return new CompatCreator(callbacks);
}
项目:boohee_v5.6    文件:ParcelableCompat.java   
public static <T> Creator<T> newCreator(ParcelableCompatCreatorCallbacks<T> callbacks) {
    if (VERSION.SDK_INT >= 13) {
        return ParcelableCompatCreatorHoneycombMR2Stub.instantiate(callbacks);
    }
    return new CompatCreator(callbacks);
}
项目:boohee_v5.6    文件:ParcelableCompatCreatorHoneycombMR2Stub.java   
static <T> Creator<T> instantiate(ParcelableCompatCreatorCallbacks<T> callbacks) {
    return new ParcelableCompatCreatorHoneycombMR2(callbacks);
}
项目:solved-hacking-problem    文件:C0032e.java   
static Creator m201a(C0030c c0030c) {
    return new C0031d(c0030c);
}
项目:solved-hacking-problem    文件:C0028a.java   
public static Creator m198a(C0030c c0030c) {
    if (VERSION.SDK_INT >= 13) {
        C0032e.m201a(c0030c);
    }
    return new C0029b(c0030c);
}
项目:QuizUpWinner    文件:c.java   
public c(DataHolder paramDataHolder, Parcelable.Creator<T> paramCreator)
{
  super(paramDataHolder);
  this.nJ = paramCreator;
}
项目:QuizUpWinner    文件:COn-3.java   
static <T> Parcelable.Creator<T> ˊ(cOn<T> paramcOn)
{
  return new ˌ(paramcOn);
}
项目:QuizUpWinner    文件:Àâ.java   
public static <T> Parcelable.Creator<T> ˊ(cOn<T> paramcOn)
{
  if (Build.VERSION.SDK_INT >= 13)
    COn.ˊ(paramcOn);
  return new ˉ.if(paramcOn);
}
项目:ingress-indonesia-dev    文件:a.java   
public static <T> Parcelable.Creator<T> a(c<T> paramc)
{
  if (Build.VERSION.SDK_INT >= 13)
    new d(paramc);
  return new b(paramc);
}
项目:postman    文件:Postman.java   
/**
 * Get a {@link Creator} that can be used for the {@code CREATOR} field of a {@link
 * Parcelable}.
 *
 * @param clazz The class associated with the type the the Creator will create.
 * @param <T> The type the Creator will create.
 *
 * @return A fully implemented Creator for the specified type.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 */
public static <T> Parcelable.Creator<T> getCreator(Class<T> clazz) throws PostmanException {
    @SuppressWarnings("unchecked")
    Parcelable.Creator<T> creator = (Parcelable.Creator<T>) creatorMap.get(clazz);
    if (creator == null) {
        creator = newCreator(clazz);
        creatorMap.put(clazz, creator);
    }
    return creator;
}