@Override public TypeVariableSource<O> removeBounds() { internal.typeBounds().clear(); return this; }
@Override public TypeVariableSource<O> removeBounds() { internal.typeBounds().clear(); return this; }
@Override public boolean visit(TypeParameter node) { List<Type> typeBounds = node.typeBounds(); for (int i = 1; i < typeBounds.size(); i++) { handleTokenBefore(typeBounds.get(i), TokenNameAND, this.options.insert_space_before_and_in_type_parameter, this.options.insert_space_after_and_in_type_parameter); } return true; }
@Override public boolean visit(TypeParameter node) { List<Type> typeBounds = node.typeBounds(); for (int i = 1; i < typeBounds.size(); i++) { handleTokenBefore(typeBounds.get(i), TokenNameAND, this.options.insert_space_before_and_in_type_parameter, this.options.insert_space_after_and_in_type_parameter); } return true; }
@Override public boolean visit(TypeParameter node) { List<Type> typeBounds = node.typeBounds(); for (int i = 1; i < typeBounds.size(); i++) { handleTokenBefore(typeBounds.get(i), TokenNameAND, this.options.insert_space_before_and_in_type_parameter, this.options.insert_space_after_and_in_type_parameter); } return true; }
private org.eclipse.jdt.core.dom.Type parseTypeBound(String bound) { String stub = "public class Stub<T extends " + bound + "> {}"; JavaClassSource temp = Roaster.parse(JavaClassSource.class, stub); TypeParameter v = (TypeParameter) temp.getTypeVariables().get(0).getInternal(); return (org.eclipse.jdt.core.dom.Type) v.typeBounds().get(0); } }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == MODIFIERS_PROPERTY) { return modifiers(); } if (property == TYPE_BOUNDS_PROPERTY) { return typeBounds(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == MODIFIERS_PROPERTY) { return modifiers(); } if (property == TYPE_BOUNDS_PROPERTY) { return typeBounds(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
private org.eclipse.jdt.core.dom.Type parseTypeBound(String bound) { String stub = "public class Stub<T extends " + bound + "> {}"; JavaClassSource temp = Roaster.parse(JavaClassSource.class, stub); TypeParameter v = (TypeParameter) temp.getTypeVariables().get(0).getInternal(); return (org.eclipse.jdt.core.dom.Type) v.typeBounds().get(0); } }
@Override final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == MODIFIERS_PROPERTY) { return modifiers(); } if (property == TYPE_BOUNDS_PROPERTY) { return typeBounds(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == MODIFIERS_PROPERTY) { return modifiers(); } if (property == TYPE_BOUNDS_PROPERTY) { return typeBounds(); } // allow default implementation to flag the error return super.internalGetChildListProperty(property); }
public boolean visit(TypeParameter node) { IValue name = values.string(node.getName().getFullyQualifiedName()); IValueList extendsList = new IValueList(values); if (!node.typeBounds().isEmpty()) { for (Iterator it = node.typeBounds().iterator(); it.hasNext();) { Type t = (Type) it.next(); extendsList.add(visitChild(t)); } } ownValue = constructDeclarationNode("typeParameter", name, extendsList.asList()); return false; }
@Override public void endVisit(TypeParameter node) { if (skipNode(node)) { return; } GenericSequentialFlowInfo info = processSequential(node, node.getName()); process(info, node.typeBounds()); }
@Override public void endVisit(TypeParameter node) { if (skipNode(node)) return; GenericSequentialFlowInfo info= processSequential(node, node.getName()); process(info, node.typeBounds()); }
ASTNode clone0(AST target) { TypeParameter result = new TypeParameter(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS8) { result.modifiers().addAll( ASTNode.copySubtrees(target, modifiers())); } result.setName((SimpleName) ((ASTNode) getName()).clone(target)); result.typeBounds().addAll( ASTNode.copySubtrees(target, typeBounds())); return result; }
@Override ASTNode clone0(AST target) { TypeParameter result = new TypeParameter(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL) { result.modifiers().addAll( ASTNode.copySubtrees(target, modifiers())); } result.setName((SimpleName) ((ASTNode) getName()).clone(target)); result.typeBounds().addAll( ASTNode.copySubtrees(target, typeBounds())); return result; }
@SuppressWarnings("unchecked") @Override public boolean visit(TypeParameter node) { pushNode(node, node.getName().getFullyQualifiedName()); visitList(node.typeBounds()); return false; }
@SuppressWarnings("unchecked") @Override public boolean visit(TypeParameter node) { pushNode(node, node.getName().getFullyQualifiedName()); visitList(node.typeBounds()); return false; }
ASTNode clone0(AST target) { TypeParameter result = new TypeParameter(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL) { result.modifiers().addAll( ASTNode.copySubtrees(target, modifiers())); } result.setName((SimpleName) ((ASTNode) getName()).clone(target)); result.typeBounds().addAll( ASTNode.copySubtrees(target, typeBounds())); return result; }
private void copyTypeParameters(MethodDeclaration intermediary, CompilationUnitRewrite rew, ImportRewriteContext context) { ITypeBinding[] typeParameters= fTargetMethodBinding.getTypeParameters(); for (int i= 0; i < typeParameters.length; i++) { ITypeBinding current= typeParameters[i]; TypeParameter parameter= rew.getAST().newTypeParameter(); parameter.setName(rew.getAST().newSimpleName(current.getName())); ITypeBinding[] bounds= current.getTypeBounds(); for (int j= 0; j < bounds.length; j++) if (!"java.lang.Object".equals(bounds[j].getQualifiedName())) //$NON-NLS-1$ parameter.typeBounds().add(rew.getImportRewrite().addImport(bounds[j], rew.getAST(), context)); intermediary.typeParameters().add(parameter); } }