Interface ResourceTemplateDescriptor

All Superinterfaces:
HasMeta, ServerFeature.Descriptor

@Immutable public interface ResourceTemplateDescriptor extends ServerFeature.Descriptor, HasMeta
Descriptor for a resource URI template.

A template describes a family of resources matching a URI pattern (e.g. file:///{path}). Each concrete URI within the template is resolved at request time via a ResourceRequest.

  • Method Details

    • name

      String name()
      The template name, unique within the server.
      Specified by:
      name in interface ServerFeature.Descriptor
    • uriTemplate

      String uriTemplate()
      The URI template pattern (e.g. file:///{path}).
    • description

      @Nullable String description()
      Optional description of the resource family.
    • mimeType

      @Nullable String mimeType()
      Optional MIME type that all matching resources share.
    • title

      @Nullable String title()
      Optional human-readable title.
    • annotations

      @Nullable Annotations annotations()
      Optional annotations shared by resources matching this template.
    • extensionId

      @Nullable String extensionId()
      Optional identifier of the extension that owns this template.
    • icons

      @Nullable List<Icon> icons()
      Optional icons for resources matching this template.
    • meta

      @Nullable Map<String,Object> meta()
      Optional protocol extension metadata.
      Specified by:
      meta in interface HasMeta
      Returns:
      the metadata map, or null if none
    • check

      @Check default void check()
      Validates the resource template descriptor's name and URI template.
      Throws:
      IllegalArgumentException - if the name or URI template is blank or invalid
    • builder

      Creates a builder for constructing resource template descriptors.
      Returns:
      a new resource template descriptor builder
    • of

      @Deprecated static ResourceTemplateDescriptor of(String name, String uriTemplate)
      Deprecated.
      Creates a template descriptor from a name and URI template pattern.
    • of

      @Deprecated static ResourceTemplateDescriptor of(String name, String uriTemplate, @Nullable String description, @Nullable String mimeType, @Nullable String title, @Nullable Annotations annotations, @Nullable List<Icon> icons, @Nullable String extensionId)
      Deprecated.
      Creates a fully specified resource template descriptor.