Example usage for org.eclipse.jdt.core.search IJavaSearchConstants DECLARATIONS

List of usage examples for org.eclipse.jdt.core.search IJavaSearchConstants DECLARATIONS

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.search IJavaSearchConstants DECLARATIONS.

Prototype

int DECLARATIONS

To view the source code for org.eclipse.jdt.core.search IJavaSearchConstants DECLARATIONS.

Click Source Link

Document

The search result is a declaration.

Usage

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodDeclaration4() throws Exception {
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx() { } }");
    createCU("Java.java", "class Java { }");
    ICompilationUnit other = createCU("Other.java", "class Other extends Java { void xxx() { } }");

    IntertypeElement itd = findFirstITD(unit);
    IMember method = findFirstChild(other);

    List<SearchMatch> matches = findSearchMatches(method, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(2, matches);
    assertDeclarationMatches(itd, matches);
    assertDeclarationMatches(method, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodDeclaration5() throws Exception {
    ICompilationUnit other = createCU("Other.java", "abstract class Other { abstract void xxx(); }");
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx() { } }");
    createCU("Java.java", "class Java extends Other { }");

    IntertypeElement itd = findFirstITD(unit);
    IMember method = findFirstChild(other);

    List<SearchMatch> matches = findSearchMatches(method, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(2, matches);
    assertDeclarationMatches(itd, matches);
    assertDeclarationMatches(method, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testQualifiedITDSearchMethodDeclaration5() throws Exception {
    ICompilationUnit other = createCU("p", "Other.java",
            "package p;\npublic abstract class Other { public abstract void xxx(); }");
    ICompilationUnit unit = createCU("q", "Aspect.aj",
            "package q;\naspect Aspect {\n public void r.Java.xxx() { } }");
    createCU("r", "Java.java", "package r;\npublic class Java extends p.Other { }");

    IntertypeElement itd = findFirstITD(unit);
    IMember method = findFirstChild(other);

    List<SearchMatch> matches = findSearchMatches(method, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(2, matches);
    assertDeclarationMatches(itd, matches);
    assertDeclarationMatches(method, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodSimpleArgDeclaration1() throws Exception {
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx(int x) { } }");
    createCU("Java.java", "class Java { }");

    IntertypeElement itd = findFirstITD(unit);

    List<SearchMatch> matches = findSearchMatches(itd, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(1, matches);
    assertDeclarationMatches(itd, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodSimpleArgDeclaration2() throws Exception {
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx(int x) { } }");
    createCU("Java.java", "class Java { }");
    ICompilationUnit other = createCU("Other.java", "class Other extends Java { void xxx(int x) { } }");

    IntertypeElement itd = findFirstITD(unit);
    IMember method = findFirstChild(other);

    List<SearchMatch> matches = findSearchMatches(itd, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(2, matches);
    assertDeclarationMatches(itd, matches);
    assertDeclarationMatches(method, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodSimpleArgDeclaration3() throws Exception {
    createCU("Other.java", "abstract class Other { abstract void xxx(int x); }");
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx(int x) { } }");
    createCU("Java.java", "class Java extends Other { }");

    IntertypeElement itd = findFirstITD(unit);

    List<SearchMatch> matches = findSearchMatches(itd, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(1, matches);
    assertDeclarationMatches(itd, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodSimpleArgDeclaration4() throws Exception {
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx(int x) { } }");
    createCU("Java.java", "class Java { }");
    ICompilationUnit other = createCU("Other.java", "class Other extends Java { void xxx(int x) { } }");

    IntertypeElement itd = findFirstITD(unit);
    IMember method = findFirstChild(other);

    List<SearchMatch> matches = findSearchMatches(method, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(2, matches);
    assertDeclarationMatches(itd, matches);
    assertDeclarationMatches(method, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodSimpleArgDeclaration5() throws Exception {
    ICompilationUnit other = createCU("Other.java", "abstract class Other { abstract void xxx(int x); }");
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx(int x) { } }");
    createCU("Java.java", "class Java extends Other { }");

    IntertypeElement itd = findFirstITD(unit);
    IMember method = findFirstChild(other);

    List<SearchMatch> matches = findSearchMatches(method, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(2, matches);
    assertDeclarationMatches(itd, matches);
    assertDeclarationMatches(method, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodStringArgDeclaration1() throws Exception {
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx(String x) { } }");
    createCU("Java.java", "class Java { }");

    IntertypeElement itd = findFirstITD(unit);

    List<SearchMatch> matches = findSearchMatches(itd, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(1, matches);
    assertDeclarationMatches(itd, matches);
}

From source file:org.eclipse.ajdt.core.tests.search.ITDAwareDeclarationSearchTests.java

License:Open Source License

public void testITDSearchMethodStringArgDeclaration2() throws Exception {
    ICompilationUnit unit = createCU("Aspect.aj", "aspect Aspect {\n void Java.xxx(String x) { } }");
    createCU("Java.java", "class Java { }");
    ICompilationUnit other = createCU("Other.java", "class Other extends Java { void xxx(String x) { } }");

    IntertypeElement itd = findFirstITD(unit);
    IMember method = findFirstChild(other);

    List<SearchMatch> matches = findSearchMatches(itd, this.getName(), IJavaSearchConstants.DECLARATIONS);
    assertExpectedNumberOfMatches(2, matches);
    assertDeclarationMatches(itd, matches);
    assertDeclarationMatches(method, matches);
}