@Override public boolean isParameterized() { if (type.isArrayType()) { return ((ArrayType) type).getElementType().isParameterizedType(); } return type.isParameterizedType(); }
public boolean isParameterizedType() { if (this.innerTypeBinding != null) { return this.innerTypeBinding.isParameterizedType(); } if (this.currentType != null) { return this.currentType.isParameterizedType(); } return false; }
@Override public boolean isParameterizedType() { if (this.innerTypeBinding != null) { return this.innerTypeBinding.isParameterizedType(); } if (this.currentType != null) { return this.currentType.isParameterizedType(); } return false; }
public boolean isParameterizedType() { if (this.innerTypeBinding != null) { return this.innerTypeBinding.isParameterizedType(); } if (this.currentType != null) { return this.currentType.isParameterizedType(); } return false; }
public boolean isParameterizedType() { if (this.innerTypeBinding != null) { return this.innerTypeBinding.isParameterizedType(); } if (this.currentType != null) { return this.currentType.isParameterizedType(); } return false; }
public boolean isParameterizedType() { if (this.innerTypeBinding != null) { return this.innerTypeBinding.isParameterizedType(); } if (this.currentType != null) { return this.currentType.isParameterizedType(); } return false; }
@Override public boolean isParameterized() { if (type.isArrayType()) { return ((ArrayType) type).getComponentType().isParameterizedType(); } return type.isParameterizedType(); }
public boolean isParameterizedType() { if (this.innerTypeBinding != null) { return this.innerTypeBinding.isParameterizedType(); } if (this.currentType != null) { return this.currentType.isParameterizedType(); } return false; }
@Override public String toString() { return "Local variable name=" + name + ", type=" + localVarDecl.getType() + ", isParameterizedType=" + localVarDecl.getType().isParameterizedType(); }
private boolean isTargetType(final Type type) { return type != null && type.isParameterizedType() && isTargetType(type.resolveBinding()); }
private void specifyTypes(Type type) { if (type.isParameterizedType()) { ParameterizedType parameterizedType = (ParameterizedType) type; List<Type> typeArgs = parameterizedType.typeArguments(); for (int i = 0; i < typeArgs.size(); i++) setTypeList(typeArgs.get(i)); } else if (type.isArrayType()) { Type arrayType = ((ArrayType) type).getElementType(); setArrayType(arrayType); } }
@Override public void endVisit(Type node) { if (node.isParameterizedType()) { // retain already parameterized types ImmutableTypeVariable2 typeVariable= fTCModel.makeImmutableTypeVariable(node.resolveBinding(), /*no boxing*/null); setConstraintVariable(node, typeVariable); } else { TypeVariable2 typeVariable= fTCModel.makeTypeVariable(node); setConstraintVariable(node, typeVariable); } }
private static String[] getVariableNameSuggestions(int variableKind, IJavaProject project, Type expectedType, Collection<String> excluded, boolean evaluateDefault) { int dim= 0; if (expectedType.isArrayType()) { ArrayType arrayType= (ArrayType)expectedType; dim= arrayType.getDimensions(); expectedType= arrayType.getElementType(); } if (expectedType.isParameterizedType()) { expectedType= ((ParameterizedType)expectedType).getType(); } String typeName= ASTNodes.getTypeName(expectedType); if (typeName.length() > 0) { return getVariableNameSuggestions(variableKind, project, typeName, dim, excluded, evaluateDefault); } return EMPTY; }
/** * Returns the substitute type. * * @param b The builder. * @param origType The original type * @param originalExpr The original expression * @return the substitute type. */ @Override protected Type substituteType(final ASTBuilder b, final Type origType, ASTNode originalExpr) { if (origType.isParameterizedType()) { return null; } final TypeNameDecider typeNameDecider = new TypeNameDecider(originalExpr); final ParameterizedType parameterizedType = b.getAST().newParameterizedType(b.copy(origType)); typeArguments(parameterizedType).clear(); typeArguments(parameterizedType).add(b.toType(elementType, typeNameDecider)); return parameterizedType; }
public void endVisit(Type node) { if (node.isParameterizedType()) { // retain already parameterized types ImmutableTypeVariable2 typeVariable= fTCModel.makeImmutableTypeVariable(node.resolveBinding(), /*no boxing*/null); setConstraintVariable(node, typeVariable); } else { TypeVariable2 typeVariable= fTCModel.makeTypeVariable(node); setConstraintVariable(node, typeVariable); } }
@Override public void endVisit(Type node) { if (node.isParameterizedType()) { // retain already parameterized types ImmutableTypeVariable2 typeVariable= fTCModel.makeImmutableTypeVariable(node.resolveBinding(), /*no boxing*/null); setConstraintVariable(node, typeVariable); } else { TypeVariable2 typeVariable= fTCModel.makeTypeVariable(node); setConstraintVariable(node, typeVariable); } }
private static String[] getVariableNameSuggestions(int variableKind, IJavaProject project, Type expectedType, Collection<String> excluded, boolean evaluateDefault) { int dim= 0; if (expectedType.isArrayType()) { ArrayType arrayType= (ArrayType)expectedType; dim= arrayType.getDimensions(); expectedType= arrayType.getElementType(); } if (expectedType.isParameterizedType()) { expectedType= ((ParameterizedType)expectedType).getType(); } String typeName= ASTNodes.getTypeName(expectedType); if (typeName.length() > 0) { return getVariableNameSuggestions(variableKind, project, typeName, dim, excluded, evaluateDefault); } return EMPTY; }
public EssentialsGeneratedMethod(final MethodDeclaration methodDeclaration, final String methodName, final String internalName) { this.methodDeclaration = methodDeclaration; this.methodName = methodName; this.internalName = internalName; final Type type = methodDeclaration.getReturnType2(); this.returnType = type; if (type != null) { if (type.isParameterizedType()) { final ParameterizedType parameterizedType = (ParameterizedType) type; final Type myType = parameterizedType.getType(); if (myType != null && myType.isSimpleType() && ((SimpleType) myType).getName().getFullyQualifiedName().equals("List")) { this.multiType = true; } } else if (type.isArrayType()) { this.multiType = true; } } }
@Override public boolean visit(ClassInstanceCreation node) { final Type type = node.getType(); if (isEnabled() && type.isParameterizedType() && node.getAnonymousClassDeclaration() == null && parentAllowsDiamondOperator(node) && canUseDiamondOperator(node, type)) { return maybeRemoveAllTypeArguments((ParameterizedType) type); } return VISIT_SUBTREE; }
public static String[] getArgumentNameSuggestions(IJavaProject project, Type type, String[] excluded) { int dim= 0; if (type.isArrayType()) { ArrayType arrayType= (ArrayType) type; dim= arrayType.getDimensions(); type= arrayType.getElementType(); } if (type.isParameterizedType()) { type= ((ParameterizedType) type).getType(); } return getVariableNameSuggestions(PARAMETER, project, ASTNodes.asString(type), dim, new ExcludedCollection(excluded), true); }