Interface ResourceTemplateDescriptor
- All Superinterfaces:
HasMeta,ServerFeature.Descriptor
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.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription@Nullable AnnotationsOptional annotations shared by resources matching this template.builder()Creates a builder for constructing resource template descriptors.default voidcheck()Validates the resource template descriptor's name and URI template.@Nullable StringOptional description of the resource family.@Nullable StringOptional identifier of the extension that owns this template.icons()Optional icons for resources matching this template.meta()Optional protocol extension metadata.@Nullable StringmimeType()Optional MIME type that all matching resources share.name()The template name, unique within the server.static ResourceTemplateDescriptorDeprecated.static ResourceTemplateDescriptorof(String name, String uriTemplate, @Nullable String description, @Nullable String mimeType, @Nullable String title, @Nullable Annotations annotations, @Nullable List<Icon> icons, @Nullable String extensionId) Deprecated.Usebuilder()@Nullable Stringtitle()Optional human-readable title.The URI template pattern (e.g.
-
Method Details
-
name
String name()The template name, unique within the server.- Specified by:
namein interfaceServerFeature.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
Optional icons for resources matching this template. -
meta
Optional protocol extension metadata. -
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.Usebuilder()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.Usebuilder()Creates a fully specified resource template descriptor.
-
builder()