Class JavaElementUriBuilder

java.lang.Object
io.quarkus.qute.JavaElementUriBuilder

public class JavaElementUriBuilder extends Object
Builder for Qute-specific URIs that reference a Java element (class, method, or annotation) from a template.

These URIs have the format:

 qute-java://<fully-qualified-class-name>[#method][@annotation]
 
Examples:
  • Class-level annotation: qute-java://com.acme.Bean@io.quarkus.qute.TemplateContents
  • Method-level annotation: qute-java://com.acme.Bean#process@io.quarkus.qute.TemplateContents

This builder is used to construct such URIs in a type-safe way and to provide utility methods to identify and parse them. It is aligned with

invalid reference
io.quarkus.qute.debug.client.JavaSourceLocationArguments#javaElementUri
.

  • Field Details

  • Method Details

    • getTypeName

      public String getTypeName()
      Returns the fully qualified Java class name for this URI.
      Returns:
      the class name
    • getMethod

      public String getMethod()
      Returns the Java method name (nullable if not specified).
      Returns:
      the method name or null
    • setMethod

      public JavaElementUriBuilder setMethod(String method)
      Sets the Java method name.
      Parameters:
      method - the method name to set
      Returns:
      this builder
    • getAnnotation

      public String getAnnotation()
      Returns the fully qualified Java annotation name (nullable if not specified).
      Returns:
      the annotation name or null
    • setAnnotation

      public JavaElementUriBuilder setAnnotation(String annotation)
      Sets the fully qualified Java annotation name.
      Parameters:
      annotation - the annotation name to set
      Returns:
      this builder
    • builder

      public static JavaElementUriBuilder builder(String typeName)
      Creates a new builder for the given Java class name.
      Parameters:
      typeName - fully qualified Java class name
      Returns:
      a new JavaElementUriBuilder
    • build

      public URI build()
      Builds the Qute Java URI representing the element.
      Returns:
      a URI for the Java element
    • isJavaUri

      public static boolean isJavaUri(URI uri)
      Returns true if the given URI uses the qute-java scheme.
      Parameters:
      uri - the URI to check
      Returns:
      true if this URI is a Qute Java element URI
    • isJavaUri

      public static boolean isJavaUri(String uri)
      Returns true if the given string starts with the qute-java URI prefix.
      Parameters:
      uri - the URI string to check
      Returns:
      true if this string is a Qute Java element URI