Search in sources :

Example 1 with JavadocFinder

use of org.eclipse.che.jdt.JavadocFinder in project che by eclipse.

the class JavadocService method findJavadoc.

@GET
@Path("find")
@Produces("text/html")
public String findJavadoc(@QueryParam("fqn") String fqn, @QueryParam("projectpath") String projectPath, @QueryParam("offset") int offset) throws JavaModelException {
    final IJavaProject project = JavaModelManager.getJavaModelManager().getJavaModel().getJavaProject(projectPath);
    final String urlPart = getUrlPart(projectPath);
    return new JavadocFinder(urlPart).findJavadoc(project, fqn, offset);
}
Also used : IJavaProject(org.eclipse.jdt.core.IJavaProject) JavadocFinder(org.eclipse.che.jdt.JavadocFinder) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with JavadocFinder

use of org.eclipse.che.jdt.JavadocFinder in project che by eclipse.

the class JavadocService method get.

@GET
@Path("get")
@Produces("text/html")
public String get(@QueryParam("handle") String handle, @QueryParam("projectpath") String projectPath) {
    final IJavaProject project = JavaModelManager.getJavaModelManager().getJavaModel().getJavaProject(projectPath);
    final String urlPart = getUrlPart(projectPath);
    return new JavadocFinder(urlPart).findJavadoc4Handle(project, handle);
}
Also used : IJavaProject(org.eclipse.jdt.core.IJavaProject) JavadocFinder(org.eclipse.che.jdt.JavadocFinder) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 3 with JavadocFinder

use of org.eclipse.che.jdt.JavadocFinder in project che by eclipse.

the class JavadocFromSourceTest method methodHandleWithParam.

@Test
public void methodHandleWithParam() throws JavaModelException, URISyntaxException, UnsupportedEncodingException {
    JavadocFinder finder = new JavadocFinder("test");
    String javadoc = finder.findJavadoc(project, "org.eclipse.che.test.MyClass", 1639);
    assertThat(javadoc).isNotNull().contains("Method with param and exception");
}
Also used : JavadocFinder(org.eclipse.che.jdt.JavadocFinder) Test(org.junit.Test)

Aggregations

JavadocFinder (org.eclipse.che.jdt.JavadocFinder)3 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 IJavaProject (org.eclipse.jdt.core.IJavaProject)2 Test (org.junit.Test)1