本文整理汇总了Java中org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType.getTypeParameters方法的典型用法代码示例。如果您正苦于以下问题:Java GenericType.getTypeParameters方法的具体用法?Java GenericType.getTypeParameters怎么用?Java GenericType.getTypeParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType
的用法示例。
在下文中一共展示了GenericType.getTypeParameters方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeFixedElementVariables
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType; //导入方法依赖的package包/类
public void makeFixedElementVariables(ConstraintVariable2 expressionCv, TType type) {
if (isAGenericType(type)) {
GenericType genericType = (GenericType) type.getTypeDeclaration();
TType[] typeParameters = genericType.getTypeParameters();
TType[] typeArguments = null;
if (type.isParameterizedType()) typeArguments = ((ParameterizedType) type).getTypeArguments();
for (int i = 0; i < typeParameters.length; i++) {
TypeVariable typeVariable = (TypeVariable) typeParameters[i];
CollectionElementVariable2 elementCv = makeElementVariable(expressionCv, typeVariable, i);
TType referenceTypeArgument;
if (typeArguments == null) { // raw type
continue; // do not consider
} else {
referenceTypeArgument = typeArguments[i];
}
createEqualsConstraint(elementCv, makeImmutableTypeVariable(referenceTypeArgument));
// if (typeVariable.getBounds().length != 0) {
// //TODO: create subtype constraints for bounds
// }
}
}
makeFixedElementVariablesFromSupertypes(expressionCv, type.getTypeDeclaration());
}
示例2: makeFixedElementVariables
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType; //导入方法依赖的package包/类
public void makeFixedElementVariables(ConstraintVariable2 expressionCv, TType type) {
if (isAGenericType(type)) {
GenericType genericType= (GenericType) type.getTypeDeclaration();
TType[] typeParameters= genericType.getTypeParameters();
TType[] typeArguments= null;
if (type.isParameterizedType())
typeArguments= ((ParameterizedType) type).getTypeArguments();
for (int i= 0; i < typeParameters.length; i++) {
TypeVariable typeVariable= (TypeVariable) typeParameters[i];
CollectionElementVariable2 elementCv= makeElementVariable(expressionCv, typeVariable, i);
TType referenceTypeArgument;
if (typeArguments == null) { // raw type
continue; // do not consider
} else {
referenceTypeArgument= typeArguments[i];
}
createEqualsConstraint(elementCv, makeImmutableTypeVariable(referenceTypeArgument));
// if (typeVariable.getBounds().length != 0) {
// //TODO: create subtype constraints for bounds
// }
}
}
makeFixedElementVariablesFromSupertypes(expressionCv, type.getTypeDeclaration());
}
示例3: makeElementVariables
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType; //导入方法依赖的package包/类
public void makeElementVariables(ConstraintVariable2 expressionCv, TType type) {
if (isAGenericType(type)) {
GenericType genericType = (GenericType) type.getTypeDeclaration();
TType[] typeParameters = genericType.getTypeParameters();
for (int i = 0; i < typeParameters.length; i++) {
TypeVariable typeVariable = (TypeVariable) typeParameters[i];
makeElementVariable(expressionCv, typeVariable, i);
if (typeVariable.getBounds().length != 0) {
// TODO: create subtype constraints for bounds
}
}
}
makeElementVariablesFromSupertypes(expressionCv, type.getTypeDeclaration());
}
示例4: makeElementVariables
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType; //导入方法依赖的package包/类
public void makeElementVariables(ConstraintVariable2 expressionCv, TType type) {
if (isAGenericType(type)) {
GenericType genericType= (GenericType) type.getTypeDeclaration();
TType[] typeParameters= genericType.getTypeParameters();
for (int i= 0; i < typeParameters.length; i++) {
TypeVariable typeVariable= (TypeVariable) typeParameters[i];
makeElementVariable(expressionCv, typeVariable, i);
if (typeVariable.getBounds().length != 0) {
//TODO: create subtype constraints for bounds
}
}
}
makeElementVariablesFromSupertypes(expressionCv, type.getTypeDeclaration());
}
示例5: ParametricStructure
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType; //导入方法依赖的package包/类
public ParametricStructure(GenericType base) {
if (base == null) throw new NullPointerException();
fBase = base;
fParameters = new ParametricStructure[base.getTypeParameters().length];
}
示例6: ParametricStructure
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType; //导入方法依赖的package包/类
public ParametricStructure(GenericType base) {
if (base == null)
throw new NullPointerException();
fBase= base;
fParameters= new ParametricStructure[base.getTypeParameters().length];
}