/**Find span of the {@link LabeledStatementTree#getLabel()} identifier in the source. * Returns starting and ending offset of the name in the source code that was parsed * (ie. {@link CompilationInfo.getText()}, which may differ from the positions in the source * document if it has been already altered. * * @param cont labeled statement which name should be searched for * @return the span of the name, or null if cannot be found * @since 0.131 */ public int[] findNameSpan(ContinueTree cont) { return findNameSpan(cont.getLabel().toString(), cont); }
/**Find span of the {@link ClassTree#getSimpleName()} identifier in the source. * Returns starting and ending offset of the name in the source code that was parsed * (ie. {@link CompilationInfo.getText()}, which may differ from the positions in the source * document if it has been already altered. * * @param clazz class which name should be searched for * @return the span of the name, or null if cannot be found * @since 0.25 */ public int[] findNameSpan(ClassTree clazz) { return findNameSpan(clazz.getSimpleName().toString(), clazz, JavaTokenId.CLASS, JavaTokenId.INTERFACE, JavaTokenId.ENUM, JavaTokenId.AT, JavaTokenId.WHITESPACE, JavaTokenId.BLOCK_COMMENT, JavaTokenId.LINE_COMMENT, JavaTokenId.JAVADOC_COMMENT); }
/**Find span of the {@link LabeledStatementTree#getLabel()} identifier in the source. * Returns starting and ending offset of the name in the source code that was parsed * (ie. {@link CompilationInfo.getText()}, which may differ from the positions in the source * document if it has been already altered. * * @param brk labeled statement which name should be searched for * @return the span of the name, or null if cannot be found * @since 0.131 */ public int[] findNameSpan(BreakTree brk) { return findNameSpan(brk.getLabel().toString(), brk); }
/**Find span of the {@link MemberSelectTree#getIdentifier()} identifier in the source. * Returns starting and ending offset of the name in the source code that was parsed * (ie. {@link CompilationInfo.getText()}, which may differ from the positions in the source * document if it has been already altered. * * @param mst member select which identifier should be searched for * @return the span of the name, or null if cannot be found * @since 0.25 */ public int[] findNameSpan(MemberSelectTree mst) { return findNameSpan(mst.getIdentifier().toString(), mst, JavaTokenId.DOT, JavaTokenId.WHITESPACE, JavaTokenId.BLOCK_COMMENT, JavaTokenId.LINE_COMMENT, JavaTokenId.JAVADOC_COMMENT); }
/**Find span of the {@link LabeledStatementTree#getLabel()} identifier in the source. * Returns starting and ending offset of the name in the source code that was parsed * (ie. {@link CompilationInfo.getText()}, which may differ from the positions in the source * document if it has been already altered. * * @param lst labeled statement which name should be searched for * @return the span of the name, or null if cannot be found * @since 0.131 */ public int[] findNameSpan(LabeledStatementTree lst) { return findNameSpan(lst.getLabel().toString(), lst); }
/**Find span of the {@link MemberReferenceTree#getName()} identifier in the source. * Returns starting and ending offset of the name in the source code that was parsed * (ie. {@link CompilationInfo.getText()}, which may differ from the positions in the source * document if it has been already altered. * * @param mst member reference for which the identifier should be searched for * @return the span of the name, or null if cannot be found * @since 0.124 */ public int[] findNameSpan(MemberReferenceTree mst) { return findNameSpan(mst.getName().toString(), mst, JavaTokenId.DOT, JavaTokenId.WHITESPACE, JavaTokenId.BLOCK_COMMENT, JavaTokenId.LINE_COMMENT, JavaTokenId.JAVADOC_COMMENT); }
/**Find span of the {@link VariableTree#getName()} identifier in the source. * Returns starting and ending offset of the name in the source code that was parsed * (ie. {@link CompilationInfo.getText()}, which may differ from the positions in the source * document if it has been already altered. * * @param var variable which name should be searched for * @return the span of the name, or null if cannot be found * @since 0.25 */ public int[] findNameSpan(VariableTree var) { return findNameSpan(var.getName().toString(), var); }
/**Find span of the {@link TypeParameterTree#getName()} identifier in the source. * Returns starting and ending offset of the name in the source code that was parsed * (ie. {@link CompilationInfo.getText()}, which may differ from the positions in the source * document if it has been already altered. * * @param tpt type parameter which name should be searched for * @return the span of the name, or null if cannot be found * @since 0.131 */ public int[] findNameSpan(TypeParameterTree tpt) { return findNameSpan(tpt.getName().toString(), tpt); }
name = method.getName().toString(); return findNameSpan(name, method);
@Override public Void visitReference(ReferenceTree node, Void p) { int[] span = javac.getTreeUtilities().findNameSpan(docComment, node); if ( span != null && span[0] <= offset
@Override public Void visitReference(ReferenceTree node, Void p) { int[] span = javac.getTreeUtilities().findNameSpan(docComment, node); if ( span != null && span[0] <= offset
int[] span = info.getTreeUtilities().findNameSpan(tree); if (span != null) tl.moveToOffset(span[0]);
int[] span = javac.getTreeUtilities().findNameSpan(docComment, node); if (span != null) { handleUsage(span[0]);
int[] nameSpan = treeUtilities.findNameSpan(oldT); printer.print(newT.name); diffInfo.put(localPointer, NbBundle.getMessage(CasualDiff.class,"TXT_UpdateReferenceTo",oldT.name));