/** * Create a new mock instance. * * @param name the name of this type * @param arguments an array of types representing arguments to this type * @param owner the enclosing type if annotated or parameterized, otherwise null * @return the mock instance * @since 2.1 */ public static ParameterizedType create(DotName name, Type[] arguments, Type owner) { return new ParameterizedType(name, arguments, owner); }
@Override ParameterizedType copyType(AnnotationInstance[] newAnnotations) { return new ParameterizedType(name(), arguments, owner, newAnnotations); }
ParameterizedType toParameterizedType() { return new ParameterizedType(name(), null, null, annotationArray()); } }
ParameterizedType copyType(Type[] parameters) { return new ParameterizedType(name(), parameters, owner, annotationArray()); }
ParameterizedType copyType(Type owner) { return new ParameterizedType(name(), arguments, owner, annotationArray()); }
private Type parseClassTypeSignature() { String signature = this.signature; DotName name = parseName(); Type[] types = parseTypeArguments(); Type type = null; if (types.length > 0) { type = new ParameterizedType(name, types, null); } // Suffix while (signature.charAt(pos) == '.') { int mark = ++pos; int suffixEnd = advanceNameEnd(); name = names.wrap(name, signature.substring(mark, suffixEnd), true); types = parseTypeArguments(); // A suffix is a parameterized type if it has typeParameters or it's owner is a parameterized type // The first parameterized type needs a standard class type for the owner if (type == null && types.length > 0) { type = names.intern(new ClassType(name.prefix())); } if (type != null) { type = names.intern(new ParameterizedType(name, types, type)); } } this.pos++; // ; return type != null ? type : names.intern(new ClassType(name)); }
: new ParameterizedType(currentName, null, last)); } else if (oType != null) { last = oType;
Type[] parameters = readTypeListReference(stream); AnnotationInstance[] annotations = readAnnotations(stream, null); return new ParameterizedType(name, parameters, owner, annotations);