Example usage for org.eclipse.jdt.internal.core.search.indexing IndexingParser IndexingParser

List of usage examples for org.eclipse.jdt.internal.core.search.indexing IndexingParser IndexingParser

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.search.indexing IndexingParser IndexingParser.

Prototype

public IndexingParser(ISourceElementRequestor requestor, IProblemFactory problemFactory,
            CompilerOptions options, boolean reportLocalDeclarations, boolean optimizeStringLiterals,
            boolean useSourceJavadocParser) 

Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.search.indexing.IndexManager.java

License:Open Source License

public SourceElementParser getSourceElementParser(JavaProject project, ISourceElementRequestor requestor) {
    // disable task tags to speed up parsing
    Map options = project.getOptions(true);
    options.put(JavaCore.COMPILER_TASK_TAGS, ""); //$NON-NLS-1$
    try {//from w  ww.j  ava2  s .  c o  m
        SourceElementParser parser = new IndexingParser(requestor,
                new DefaultProblemFactory(Locale.getDefault()), new CompilerOptions(options), true, // index local declarations
                true, // optimize string literals
                false); // do not use source javadoc parser to speed up parsing
        parser.reportOnlyOneSyntaxError = true;

        // Always check javadoc while indexing
        parser.javadocParser.checkDocComment = true;
        parser.javadocParser.reportProblems = false;

        return parser;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}

From source file:org.codehaus.jdt.groovy.integration.DefaultLanguageSupport.java

License:Open Source License

public IndexingParser getIndexingParser(ISourceElementRequestor requestor, IProblemFactory problemFactory,
        CompilerOptions options, boolean reportLocalDeclarations, boolean optimizeStringLiterals,
        boolean useSourceJavadocParser) {
    return new IndexingParser(requestor, problemFactory, options, reportLocalDeclarations,
            optimizeStringLiterals, useSourceJavadocParser);
}

From source file:org.eclipse.che.jdt.internal.core.search.indexing.IndexManager.java

License:Open Source License

public SourceElementParser getSourceElementParser(IJavaProject project, ISourceElementRequestor requestor) {
    // disable task tags to speed up parsing
    Map options = project.getOptions(true);
    options.put(JavaCore.COMPILER_TASK_TAGS, ""); //$NON-NLS-1$
    try {//from  ww w  .  j  a  v a2  s . c o  m
        SourceElementParser parser = new IndexingParser(requestor,
                new DefaultProblemFactory(Locale.getDefault()), new CompilerOptions(options), true, // index local declarations
                true, // optimize string literals
                false); // do not use source javadoc parser to speed up parsing
        parser.reportOnlyOneSyntaxError = true;

        // Always check javadoc while indexing
        parser.javadocParser.checkDocComment = true;
        parser.javadocParser.reportProblems = false;

        return parser;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}