本文整理汇总了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);
}
}
示例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();
}
示例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]);
}
}
示例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]);
}
}
示例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);
}
}
示例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++;
}
}
示例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]);
}
}
示例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]);
}
}
示例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]);
}
}
示例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]);
}
}
示例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]);
}
}
示例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);
}
}
示例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]);
}
}
示例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]);
}
}
示例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]);
}
}