当前位置: 首页>>代码示例>>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;未经允许,请勿转载。