當前位置: 首頁>>代碼示例>>Java>>正文


Java Type.clone方法代碼示例

本文整理匯總了Java中java.lang.reflect.Type.clone方法的典型用法代碼示例。如果您正苦於以下問題:Java Type.clone方法的具體用法?Java Type.clone怎麽用?Java Type.clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.lang.reflect.Type的用法示例。


在下文中一共展示了Type.clone方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
  // Require an owner type if the raw type needs it.
  if (rawType instanceof Class<?>
      && (ownerType == null) != (((Class<?>) rawType).getEnclosingClass() == null)) {
    throw new IllegalArgumentException();
  }

  this.ownerType = ownerType;
  this.rawType = rawType;
  this.typeArguments = typeArguments.clone();

  for (Type typeArgument : this.typeArguments) {
    checkNotNull(typeArgument, "typeArgument == null");
    checkNotPrimitive(typeArgument);
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:Utils.java

示例2: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
  // Require an owner type if the raw type needs it.
  if (rawType instanceof Class<?>
      && (ownerType == null) != (((Class<?>) rawType).getEnclosingClass() == null)) {
    throw new IllegalArgumentException();
  }

  for (Type typeArgument : typeArguments) {
    checkNotNull(typeArgument, "typeArgument == null");
    checkNotPrimitive(typeArgument);
  }

  this.ownerType = ownerType;
  this.rawType = rawType;
  this.typeArguments = typeArguments.clone();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:Utils.java

示例3: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
    // Require an owner type if the raw type needs it.
    if (rawType instanceof Class<?> &&
                (ownerType == null) != (((Class<?>) rawType).getEnclosingClass() == null)) {
        throw new IllegalArgumentException("unexpected owner type for " + rawType + ": " + ownerType);
    }

    this.ownerType = ownerType == null ? null : canonicalize(ownerType);
    this.rawType = canonicalize(rawType);
    this.typeArguments = typeArguments.clone();
    for (int t = 0; t < this.typeArguments.length; t++) {
        if (this.typeArguments[t] == null) throw new NullPointerException();
        checkNotPrimitive(this.typeArguments[t]);
        this.typeArguments[t] = canonicalize(this.typeArguments[t]);
    }
}
 
開發者ID:pCloud,項目名稱:pcloud-networking-java,代碼行數:17,代碼來源:Types.java

示例4: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
    // require an owner type if the raw type needs it
    if (rawType instanceof Class<?>) {
        Class rawTypeAsClass = (Class) rawType;
        if (ownerType == null && rawTypeAsClass.getEnclosingClass() != null) {
            throw new IllegalArgumentException("No owner type for enclosed " + rawType);
        }
        if (ownerType != null && rawTypeAsClass.getEnclosingClass() == null) {
            throw new IllegalArgumentException("Owner type for unenclosed " + rawType);
        }

    }

    this.ownerType = ownerType == null ? null : canonicalize(ownerType);
    this.rawType = canonicalize(rawType);
    this.typeArguments = typeArguments.clone();
    for (int t = 0; t < this.typeArguments.length; t++) {
        Objects.requireNonNull(this.typeArguments[t], "type parameter");
        checkNotPrimitive(this.typeArguments[t], "type parameters");
        this.typeArguments[t] = canonicalize(this.typeArguments[t]);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:23,代碼來源:MoreTypes.java

示例5: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
    // Require an owner type if the raw type needs it.
    if (rawType instanceof Class<?>
            && (ownerType == null) != (((Class<?>) rawType).getEnclosingClass() == null)) {
        throw new IllegalArgumentException();
    }

    this.ownerType = ownerType;
    this.rawType = rawType;
    this.typeArguments = typeArguments.clone();

    for (Type typeArgument : this.typeArguments) {
        if (typeArgument == null) throw new NullPointerException();
        checkNotPrimitive(typeArgument);
    }
}
 
開發者ID:octaware,項目名稱:super-volley,代碼行數:17,代碼來源:Utils.java

示例6: d

import java.lang.reflect.Type; //導入方法依賴的package包/類
public d(Type type, Type type2, Type... typeArr) {
    int i = 0;
    if (type2 instanceof Class) {
        Class cls = (Class) type2;
        int i2 = (Modifier.isStatic(cls.getModifiers()) || cls.getEnclosingClass() == null) ? 1 : 0;
        boolean z = (type == null && i2 == 0) ? false : true;
        a.a(z);
    }
    this.a = type == null ? null : b.a(type);
    this.b = b.a(type2);
    this.c = (Type[]) typeArr.clone();
    while (i < this.c.length) {
        a.a(this.c[i]);
        b.e(this.c[i]);
        this.c[i] = b.a(this.c[i]);
        i++;
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:19,代碼來源:d.java

示例7: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
    boolean z = false;
    if (rawType instanceof Class) {
        boolean z2;
        Class<?> rawTypeAsClass = (Class) rawType;
        if (ownerType != null || rawTypeAsClass.getEnclosingClass() == null) {
            z2 = true;
        } else {
            z2 = false;
        }
        C$Gson$Preconditions.checkArgument(z2);
        if (ownerType == null || rawTypeAsClass.getEnclosingClass() != null) {
            z = true;
        }
        C$Gson$Preconditions.checkArgument(z);
    }
    this.ownerType = ownerType == null ? null : C$Gson$Types.canonicalize(ownerType);
    this.rawType = C$Gson$Types.canonicalize(rawType);
    this.typeArguments = (Type[]) typeArguments.clone();
    for (int t = 0; t < this.typeArguments.length; t++) {
        C$Gson$Preconditions.checkNotNull(this.typeArguments[t]);
        C$Gson$Types.checkNotPrimitive(this.typeArguments[t]);
        this.typeArguments[t] = C$Gson$Types.canonicalize(this.typeArguments[t]);
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:26,代碼來源:C$Gson$Types.java

示例8: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
  // require an owner type if the raw type needs it
  if (rawType instanceof Class<?>) {
    Class<?> rawTypeAsClass = (Class<?>) rawType;
    boolean isStaticOrTopLevelClass = Modifier.isStatic(rawTypeAsClass.getModifiers())
        || rawTypeAsClass.getEnclosingClass() == null;
    checkArgument(ownerType != null || isStaticOrTopLevelClass);
  }

  this.ownerType = ownerType == null ? null : canonicalize(ownerType);
  this.rawType = canonicalize(rawType);
  this.typeArguments = typeArguments.clone();
  for (int t = 0; t < this.typeArguments.length; t++) {
    checkNotNull(this.typeArguments[t]);
    checkNotPrimitive(this.typeArguments[t]);
    this.typeArguments[t] = canonicalize(this.typeArguments[t]);
  }
}
 
開發者ID:odoo-mobile-intern,項目名稱:odoo-work,代碼行數:19,代碼來源:$Gson$Types.java

示例9: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
  // require an owner type if the raw type needs it
  if (rawType instanceof Class<?>) {
    Class<?> rawTypeAsClass = (Class<?>) rawType;
    checkArgument(ownerType != null || rawTypeAsClass.getEnclosingClass() == null);
    checkArgument(ownerType == null || rawTypeAsClass.getEnclosingClass() != null);
  }

  this.ownerType = ownerType == null ? null : canonicalize(ownerType);
  this.rawType = canonicalize(rawType);
  this.typeArguments = typeArguments.clone();
  for (int t = 0; t < this.typeArguments.length; t++) {
    checkNotNull(this.typeArguments[t]);
    checkNotPrimitive(this.typeArguments[t]);
    this.typeArguments[t] = canonicalize(this.typeArguments[t]);
  }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:18,代碼來源:$Gson$Types.java

示例10: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
ParameterizedTypeImpl(@Nullable Type ownerType, Type rawType, Type... typeArguments) {
  // Require an owner type if the raw type needs it.
  if (rawType instanceof Class<?>
      && (ownerType == null) != (((Class<?>) rawType).getEnclosingClass() == null)) {
    throw new IllegalArgumentException(
        "unexpected owner type for " + rawType + ": " + ownerType);
  }

  this.ownerType = ownerType == null ? null : canonicalize(ownerType);
  this.rawType = canonicalize(rawType);
  this.typeArguments = typeArguments.clone();
  for (int t = 0; t < this.typeArguments.length; t++) {
    if (this.typeArguments[t] == null) throw new NullPointerException();
    checkNotPrimitive(this.typeArguments[t]);
    this.typeArguments[t] = canonicalize(this.typeArguments[t]);
  }
}
 
開發者ID:hzsweers,項目名稱:inspector,代碼行數:18,代碼來源:Types.java

示例11: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
    // require an owner type if the raw type needs it
    if (rawType instanceof Class<?>) {
        Class<?> rawTypeAsClass = (Class<?>) rawType;
        boolean isStaticOrTopLevelClass = Modifier.isStatic(rawTypeAsClass.getModifiers())
                || rawTypeAsClass.getEnclosingClass() == null;
        checkArgument(ownerType != null || isStaticOrTopLevelClass);
    }

    this.ownerType = ownerType == null ? null : canonicalize(ownerType);
    this.rawType = canonicalize(rawType);
    this.typeArguments = typeArguments.clone();
    for (int t = 0; t < this.typeArguments.length; t++) {
        checkNotNull(this.typeArguments[t]);
        this.typeArguments[t] = canonicalize(this.typeArguments[t]);
    }
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:18,代碼來源:CacheManager.java

示例12: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
  // Require an owner type if the raw type needs it.
  if (rawType instanceof Class<?>
      && (ownerType == null) != (((Class<?>) rawType).getEnclosingClass() == null)) {
    throw new IllegalArgumentException();
  }

  this.ownerType = ownerType;
  this.rawType = rawType;
  this.typeArguments = typeArguments.clone();

  for (Type typeArgument : this.typeArguments) {
    if (typeArgument == null) {
      throw new NullPointerException();
    }
    checkNotPrimitive(typeArgument);
  }
}
 
開發者ID:wenwu315,項目名稱:XXXX,代碼行數:19,代碼來源:Types.java

示例13: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
    boolean z = false;
    if (rawType instanceof Class) {
        Class<?> rawTypeAsClass = (Class) rawType;
        boolean isStaticOrTopLevelClass;
        if (Modifier.isStatic(rawTypeAsClass.getModifiers()) || rawTypeAsClass
                .getEnclosingClass() == null) {
            isStaticOrTopLevelClass = true;
        } else {
            isStaticOrTopLevelClass = false;
        }
        if (ownerType != null || isStaticOrTopLevelClass) {
            z = true;
        }
        C$Gson$Preconditions.checkArgument(z);
    }
    this.ownerType = ownerType == null ? null : C$Gson$Types.canonicalize(ownerType);
    this.rawType = C$Gson$Types.canonicalize(rawType);
    this.typeArguments = (Type[]) typeArguments.clone();
    for (int t = 0; t < this.typeArguments.length; t++) {
        C$Gson$Preconditions.checkNotNull(this.typeArguments[t]);
        C$Gson$Types.checkNotPrimitive(this.typeArguments[t]);
        this.typeArguments[t] = C$Gson$Types.canonicalize(this.typeArguments[t]);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:26,代碼來源:C$Gson$Types.java

示例14: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
  // Require an owner type if the raw type needs it.
  if (rawType instanceof Class<?>
    && (ownerType == null) != (((Class<?>) rawType).getEnclosingClass() == null)) {
    throw new IllegalArgumentException(
      "unexpected owner type for " + rawType + ": " + ownerType);
  }

  this.ownerType = ownerType == null ? null : canonicalize(ownerType);
  this.rawType = canonicalize(rawType);
  this.typeArguments = typeArguments.clone();
  for (int t = 0; t < this.typeArguments.length; t++) {
    if (this.typeArguments[t] == null) throw new NullPointerException();
    checkNotPrimitive(this.typeArguments[t]);
    this.typeArguments[t] = canonicalize(this.typeArguments[t]);
  }
}
 
開發者ID:rogues-dev,項目名稱:hoard,代碼行數:18,代碼來源:Types.java

示例15: ParameterizedTypeImpl

import java.lang.reflect.Type; //導入方法依賴的package包/類
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
  // require an owner type if the raw type needs it
  ensureOwnerType(ownerType, rawType);

  this.ownerType = ownerType == null ? null : canonicalize(ownerType);
  this.rawType = canonicalize(rawType);
  this.typeArguments = typeArguments.clone();
  for (int t = 0; t < this.typeArguments.length; t++) {
    throwIfNull(this.typeArguments[t], "type parameter");
    checkNotPrimitive(this.typeArguments[t], "type parameters");
    this.typeArguments[t] = canonicalize(this.typeArguments[t]);
  }
}
 
開發者ID:rockscript,項目名稱:rockscript,代碼行數:14,代碼來源:ParameterizedTypeImpl.java


注:本文中的java.lang.reflect.Type.clone方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。