List of usage examples for org.eclipse.jdt.core.dom TryStatement accept
public final void accept(ASTVisitor visitor)
From source file:org.eclipse.recommenders.codesearch.rcp.index.indexer.FullTextIndexer2.java
License:Open Source License
@Override public void indexTryCatchBlock(final Document document, final TryStatement tryStatement, final CatchClause catchClause) { tryStatement.accept(new LiteralsCollector(document)); }
From source file:org.eclipse.recommenders.codesearch.rcp.index.indexer.UsedMethodsInTryIndexer.java
License:Open Source License
@Override public void indexTryCatchBlock(final Document document, final TryStatement tryStatement, final CatchClause catchClause) { final ASTVisitor visitor = new MethodCallVisitor() { @Override//from w ww . j a v a2 s. co m protected void handleMethodCall(final IMethodBinding methodBinding) { final Optional<String> opt = BindingHelper.getIdentifier(methodBinding); if (opt.isPresent()) { CodeIndexer.addFieldToDocument(document, Fields.USED_METHODS_IN_TRY, opt.get()); } }; }; tryStatement.accept(visitor); }
From source file:org.eclipse.recommenders.codesearch.rcp.index.indexer.UsedTypesInTryIndexer.java
License:Open Source License
@Override public void indexTryCatchBlock(final Document document, final TryStatement tryStatement, final CatchClause catchClause) { final TypeUseVisitor visitor = new TypeUseVisitor() { @Override/* ww w . jav a 2 s .c om*/ protected void handleTypeUse(final ITypeBinding typeBinding) { addUsedType(document, typeBinding); } }; tryStatement.accept(visitor); }