@Override public TypeVariableSource<O> setName(String name) { internal.setName(internal.getAST().newSimpleName(name)); return this; }
@Override public TypeVariableSource<O> setName(String name) { internal.setName(internal.getAST().newSimpleName(name)); return this; }
@SuppressWarnings("unchecked") @Override public TypeVariableSource<O> setBounds(String... bounds) { internal.typeBounds().clear(); for (String s : bounds) { org.eclipse.jdt.core.dom.Type copy = (org.eclipse.jdt.core.dom.Type) ASTNode.copySubtree(internal.getAST(), parseTypeBound(s)); internal.typeBounds().add(copy); } return this; }
@SuppressWarnings("unchecked") @Override public TypeVariableSource<O> setBounds(String... bounds) { internal.typeBounds().clear(); for (String s : bounds) { org.eclipse.jdt.core.dom.Type copy = (org.eclipse.jdt.core.dom.Type) ASTNode.copySubtree(internal.getAST(), parseTypeBound(s)); internal.typeBounds().add(copy); } return this; }
public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= AST.JLS8) { printModifiers(node.modifiers()); } node.getName().accept(this); if (!node.typeBounds().isEmpty()) { this.buffer.append(" extends ");//$NON-NLS-1$ for (Iterator it = node.typeBounds().iterator(); it.hasNext(); ) { Type t = (Type) it.next(); t.accept(this); if (it.hasNext()) { this.buffer.append(" & ");//$NON-NLS-1$ } } } return false; }
public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= AST.JLS8) { visitList(node, TypeParameter.MODIFIERS_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' ')); } getChildNode(node, TypeParameter.NAME_PROPERTY).accept(this); visitList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, " & ", " extends ", Util.EMPTY_STRING); //$NON-NLS-1$ //$NON-NLS-2$ return false; }
public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= AST.JLS8) { visitList(node, TypeParameter.MODIFIERS_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' ')); } getChildNode(node, TypeParameter.NAME_PROPERTY).accept(this); visitList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, " & ", " extends ", Util.EMPTY_STRING); //$NON-NLS-1$ //$NON-NLS-2$ return false; }
public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= AST.JLS8) { printModifiers(node.modifiers()); } node.getName().accept(this); if (!node.typeBounds().isEmpty()) { this.buffer.append(" extends ");//$NON-NLS-1$ for (Iterator it = node.typeBounds().iterator(); it.hasNext(); ) { Type t = (Type) it.next(); t.accept(this); if (it.hasNext()) { this.buffer.append(" & ");//$NON-NLS-1$ } } } return false; }
@Override public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= JLS8_INTERNAL) { visitList(node, TypeParameter.MODIFIERS_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' ')); } getChildNode(node, TypeParameter.NAME_PROPERTY).accept(this); visitList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, " & ", " extends ", Util.EMPTY_STRING); //$NON-NLS-1$ //$NON-NLS-2$ return false; }
@Override public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= JLS8) { printModifiers(node.modifiers()); } node.getName().accept(this); if (!node.typeBounds().isEmpty()) { this.buffer.append(" extends ");//$NON-NLS-1$ for (Iterator it = node.typeBounds().iterator(); it.hasNext(); ) { Type t = (Type) it.next(); t.accept(this); if (it.hasNext()) { this.buffer.append(" & ");//$NON-NLS-1$ } } } return false; }
public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= JLS8_INTERNAL) { visitList(node, TypeParameter.MODIFIERS_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' ')); } getChildNode(node, TypeParameter.NAME_PROPERTY).accept(this); visitList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, " & ", " extends ", Util.EMPTY_STRING); //$NON-NLS-1$ //$NON-NLS-2$ return false; }
public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= AST.JLS8) { visitList(node, TypeParameter.MODIFIERS_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' ')); } getChildNode(node, TypeParameter.NAME_PROPERTY).accept(this); visitList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, " & ", " extends ", Util.EMPTY_STRING); //$NON-NLS-1$ //$NON-NLS-2$ return false; }
public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= JLS8) { printModifiers(node.modifiers()); } node.getName().accept(this); if (!node.typeBounds().isEmpty()) { this.buffer.append(" extends ");//$NON-NLS-1$ for (Iterator it = node.typeBounds().iterator(); it.hasNext(); ) { Type t = (Type) it.next(); t.accept(this); if (it.hasNext()) { this.buffer.append(" & ");//$NON-NLS-1$ } } } return false; }
public boolean visit(TypeParameter node) { if (node.getAST().apiLevel() >= AST.JLS8) { printModifiers(node.modifiers()); } node.getName().accept(this); if (!node.typeBounds().isEmpty()) { this.buffer.append(" extends ");//$NON-NLS-1$ for (Iterator it = node.typeBounds().iterator(); it.hasNext(); ) { Type t = (Type) it.next(); t.accept(this); if (it.hasNext()) { this.buffer.append(" & ");//$NON-NLS-1$ } } } return false; }
@Override public boolean visit(TypeParameter node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } int pos; if (node.getAST().apiLevel() >= JLS8_INTERNAL) { pos = rewriteModifiers2(node, TypeParameter.MODIFIERS_PROPERTY, node.getStartPosition()); } pos= rewriteRequiredNode(node, TypeParameter.NAME_PROPERTY); rewriteNodeList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, pos, " extends ", " & "); //$NON-NLS-1$ //$NON-NLS-2$ return false; }
public boolean visit(TypeParameter node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } int pos; if (node.getAST().apiLevel() >= AST.JLS8) { pos = rewriteModifiers2(node, TypeParameter.MODIFIERS_PROPERTY, node.getStartPosition()); } pos= rewriteRequiredNode(node, TypeParameter.NAME_PROPERTY); rewriteNodeList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, pos, " extends ", " & "); //$NON-NLS-1$ //$NON-NLS-2$ return false; } /* (non-Javadoc)
public boolean visit(TypeParameter node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } int pos; if (node.getAST().apiLevel() >= AST.JLS8) { pos = rewriteModifiers2(node, TypeParameter.MODIFIERS_PROPERTY, node.getStartPosition()); } pos= rewriteRequiredNode(node, TypeParameter.NAME_PROPERTY); rewriteNodeList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, pos, " extends ", " & "); //$NON-NLS-1$ //$NON-NLS-2$ return false; } /* (non-Javadoc)
public boolean visit(TypeParameter node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } int pos; if (node.getAST().apiLevel() >= JLS8_INTERNAL) { pos = rewriteModifiers2(node, TypeParameter.MODIFIERS_PROPERTY, node.getStartPosition()); } pos= rewriteRequiredNode(node, TypeParameter.NAME_PROPERTY); rewriteNodeList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, pos, " extends ", " & "); //$NON-NLS-1$ //$NON-NLS-2$ return false; } /* (non-Javadoc)
public boolean visit(TypeParameter node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } int pos; if (node.getAST().apiLevel() >= AST.JLS8) { pos = rewriteModifiers2(node, TypeParameter.MODIFIERS_PROPERTY, node.getStartPosition()); } pos= rewriteRequiredNode(node, TypeParameter.NAME_PROPERTY); rewriteNodeList(node, TypeParameter.TYPE_BOUNDS_PROPERTY, pos, " extends ", " & "); //$NON-NLS-1$ //$NON-NLS-2$ return false; } /* (non-Javadoc)
/** * Returns whether the given node and the other object match. * <p> * The default implementation provided by this class tests whether the * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> * * @param node the node * @param other the other object, or <code>null</code> * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 */ public boolean match(TypeParameter node, Object other) { if (!(other instanceof TypeParameter)) { return false; } TypeParameter o = (TypeParameter) other; int level = node.getAST().apiLevel; return (level >= AST.JLS8 ? safeSubtreeListMatch(node.modifiers(), o.modifiers()) : true) && safeSubtreeMatch(node.getName(), o.getName()) && safeSubtreeListMatch(node.typeBounds(), o.typeBounds()); }