- All Known Subinterfaces:
Debugger,QuteDebugProtocolClient
- All Known Implementing Classes:
DebuggeeAgent,EventBasedJavaSourceResolver
Implementations of this interface provide a way to resolve a Qute template reference
(via a qute-java:// URI) to the corresponding Java source file and template position.
This resolver is used by the Debug Adapter Protocol (DAP) **only to support breakpoints** on Java methods or classes related to Qute templates.
Example with a Qute template in a JAX-RS resource
package org.acme.quarkus.sample;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import io.quarkus.qute.TemplateContents;
import io.quarkus.qute.TemplateInstance;
@Path("hello")
public class HelloResource {
@TemplateContents("""
<p>Hello {name ?: "Qute"}</p>!
""")
record Hello(String name) implements TemplateInstance {
}
@GET
@Produces(MediaType.TEXT_PLAIN)
public TemplateInstance get(@QueryParam("name") String name) {
return new Hello(name);
}
}
Corresponding qute-java:// URI for the record:
qute-java://org.acme.quarkus.sample.HelloResource$Hello@io.quarkus.qute.TemplateContents
Parsed into JavaSourceLocationArguments:
- unresolvedUri = "qute-java://org.acme.quarkus.sample.HelloResource$Hello@io.quarkus.qute.TemplateContents"
- typeName = "org.acme.quarkus.sample.HelloResource$Hello"
- method = null (the annotation is on the record class)
- annotation = "io.quarkus.qute.TemplateContents"
Example resulting JavaSourceLocationResponse:
- javaFileUri = "file:///path/to/project/src/main/java/org/acme/quarkus/sample/HelloResource.java"
- startLine = 16 (line of the text block content of the TemplateContents annotation)
-
Method Summary
Modifier and TypeMethodDescriptionResolves the Java method or class referenced from a Qute template for the purpose of setting breakpoints.
-
Method Details
-
resolveJavaSource
Resolves the Java method or class referenced from a Qute template for the purpose of setting breakpoints.The
JavaSourceLocationArgumentscontains the parsed information from aqute-java://URI. The method returns aCompletableFuturethat completes with aJavaSourceLocationResponsecontaining the Java file URI and the start line of the template content (or the method/class if applicable).- Parameters:
args- the arguments describing the Java element to resolve- Returns:
- a future completing with the resolved Java source location
-