List of usage examples for org.eclipse.jdt.core.dom MethodDeclaration getLocationInParent
public final StructuralPropertyDescriptor getLocationInParent()
null
if this is a root node. From source file:org.jboss.tools.ws.jaxrs.ui.contentassist.MemberDeclarationVisitor.java
License:Open Source License
@Override public boolean visit(MethodDeclaration node) { if (sourceOverview == null) { try {// w ww .ja v a 2s . com ISourceRange sourceRange = member.getSourceRange(); int memberStartPosition = sourceRange.getOffset(); int memberEndPosition = memberStartPosition + sourceRange.getLength(); int nodeStartPosition = node.getStartPosition(); if (memberStartPosition <= nodeStartPosition && nodeStartPosition <= memberEndPosition) { Javadoc javaDoc = node.getJavadoc(); Block body = node.getBody(); node.getLocationInParent(); int beginIndex = (javaDoc != null) ? (javaDoc.getStartPosition() + javaDoc.getLength()) : member.getSourceRange().getOffset(); sourceOverview = member.getCompilationUnit().getSource() .substring(beginIndex, body.getStartPosition()).trim(); } } catch (JavaModelException e) { Logger.warn("Failed to visit node", e); } } return super.visit(node); }