static ASTNode[] getSiblingNodes(ASTNode node) { ASTNode parent= node.getParent(); StructuralPropertyDescriptor locationInParent= node.getLocationInParent(); if (locationInParent.isChildListProperty()) { List<? extends ASTNode> siblings= ASTNodes.getChildListProperty(parent, (ChildListPropertyDescriptor) locationInParent); return siblings.toArray(new ASTNode[siblings.size()]); } return null; }
static ASTNode[] getSiblingNodes(ASTNode node) { ASTNode parent= node.getParent(); StructuralPropertyDescriptor locationInParent= node.getLocationInParent(); if (locationInParent.isChildListProperty()) { List<? extends ASTNode> siblings= ASTNodes.getChildListProperty(parent, (ChildListPropertyDescriptor) locationInParent); return siblings.toArray(new ASTNode[siblings.size()]); } return null; }
/** * Returns the list that contains the given ASTNode. If the node * isn't part of any list, <code>null</code> is returned. * * @param node the node in question * @return the list that contains the node or <code>null</code> */ public static List<? extends ASTNode> getContainingList(ASTNode node) { StructuralPropertyDescriptor locationInParent= node.getLocationInParent(); if (locationInParent != null && locationInParent.isChildListProperty()) { return getChildListProperty(node.getParent(), (ChildListPropertyDescriptor) locationInParent); } return null; }
/** * Returns the list that contains the given ASTNode. If the node * isn't part of any list, <code>null</code> is returned. * * @param node the node in question * @return the list that contains the node or <code>null</code> */ public static List<? extends ASTNode> getContainingList(ASTNode node) { StructuralPropertyDescriptor locationInParent= node.getLocationInParent(); if (locationInParent != null && locationInParent.isChildListProperty()) { return getChildListProperty(node.getParent(), (ChildListPropertyDescriptor) locationInParent); } return null; }
/** * Add the given node to the set of "tight" nodes. * * @param reference a node * @since 3.2 */ public void addTightSourceNode(ASTNode reference) { fTightSourceRangeNodes.add(reference); List<StructuralPropertyDescriptor> properties= reference.structuralPropertiesForType(); for (Iterator<StructuralPropertyDescriptor> iterator= properties.iterator(); iterator.hasNext();) { StructuralPropertyDescriptor descriptor= iterator.next(); if (descriptor.isChildProperty()) { ASTNode child= (ASTNode)reference.getStructuralProperty(descriptor); if (child != null && isExtending(child, reference)) { addTightSourceNode(child); } } else if (descriptor.isChildListProperty()) { List<? extends ASTNode> children= ASTNodes.getChildListProperty(reference, (ChildListPropertyDescriptor) descriptor); for (Iterator<? extends ASTNode> iterator2= children.iterator(); iterator2.hasNext();) { ASTNode child= iterator2.next(); if (isExtending(child, reference)) { addTightSourceNode(child); } } } } }
/** * Add the given node to the set of "tight" nodes. * * @param reference a node * @since 3.2 */ public void addTightSourceNode(ASTNode reference) { fTightSourceRangeNodes.add(reference); List<StructuralPropertyDescriptor> properties= reference.structuralPropertiesForType(); for (Iterator<StructuralPropertyDescriptor> iterator= properties.iterator(); iterator.hasNext();) { StructuralPropertyDescriptor descriptor= iterator.next(); if (descriptor.isChildProperty()) { ASTNode child= (ASTNode)reference.getStructuralProperty(descriptor); if (child != null && isExtending(child, reference)) { addTightSourceNode(child); } } else if (descriptor.isChildListProperty()) { List<? extends ASTNode> children= ASTNodes.getChildListProperty(reference, (ChildListPropertyDescriptor) descriptor); for (Iterator<? extends ASTNode> iterator2= children.iterator(); iterator2.hasNext();) { ASTNode child= iterator2.next(); if (isExtending(child, reference)) { addTightSourceNode(child); } } } } }
List<? extends ASTNode> list= ASTNodes.getChildListProperty(statementParent, (ChildListPropertyDescriptor) property);
List<? extends ASTNode> list= ASTNodes.getChildListProperty(statementParent, (ChildListPropertyDescriptor) property);
List<BodyDeclaration> decls= ASTNodes.<BodyDeclaration>getChildListProperty(newTypeDecl, property);
List<Statement> statements = ASTNodes.<Statement>getChildListProperty(selectedNode.getParent(), (ChildListPropertyDescriptor) selectedNode.getLocationInParent()); int idx = statements.indexOf(selectedNode);
List<Statement> statements= ASTNodes.<Statement>getChildListProperty(selectedNode.getParent(), (ChildListPropertyDescriptor) selectedNode.getLocationInParent()); int idx= statements.indexOf(selectedNode);
List<Statement> statements= ASTNodes.<Statement>getChildListProperty(selectedNode.getParent(), (ChildListPropertyDescriptor) selectedNode.getLocationInParent()); int idx= statements.indexOf(selectedNode);
newStringLiteral.setLiteralValue(fWarningToken); Annotation existing= findExistingAnnotation(ASTNodes.getChildListProperty(fNode, fProperty)); if (existing == null) { ListRewrite listRewrite= rewrite.getListRewrite(fNode, fProperty);
newStringLiteral.setLiteralValue(fWarningToken); Annotation existing= findExistingAnnotation(ASTNodes.getChildListProperty(fNode, fProperty)); if (existing == null) { ListRewrite listRewrite= rewrite.getListRewrite(fNode, fProperty);
List<BodyDeclaration> decls= ASTNodes.<BodyDeclaration>getChildListProperty(newTypeDecl, property);
List<BodyDeclaration> decls= ASTNodes.<BodyDeclaration>getChildListProperty(newTypeDecl, property);