Interface ServiceExtension


public interface ServiceExtension
Describes one info.json service extension (e.g. C2PA provenance or UltraHDR gain-map support) so the core info.json handling can advertise and validate it without knowing the extension itself.

Implementations live in the extension modules and are discovered via ServiceLoader (register with @AutoService(ServiceExtension.class)). Core ships no implementations: on a core-only classpath, extension service entries validate as generic services.

Each implementation additionally ships a self-contained JSON Schema fragment (see schemaResource()) constraining only the service entries that claim its profileUri(); the validator composes all discovered fragments with the base Image API schema via allOf. Fragments apply to Image API 3 only — Image API 2 extensions are plain URIs in the embedded profile supports list and need no schema.

  • Method Details

    • profileUri

      String profileUri()
      Returns:
      The service profile URI identifying this extension, e.g. https://christianmahnke.de/iiif/c2pa/.
    • contextUri

      String contextUri()
      Returns:
      The JSON-LD context URI that must accompany the service entry in a V3 @context array, e.g. https://christianmahnke.de/iiif/c2pa/context.json.
    • schemaResource

      String schemaResource()
      Returns:
      Classpath resource path of the JSON Schema fragment for this extension, loaded through the implementation class, e.g. "/schema/c2pa-service.json".
    • schemaFragment

      default tools.jackson.databind.JsonNode schemaFragment()
      Loads the schema fragment as a Jackson tree.
      Returns:
      The parsed fragment; never null.
      Throws:
      IllegalStateException - if the resource cannot be read.
    • loadAll

      static List<ServiceExtension> loadAll()
      Loads all ServiceExtension implementations in ServiceLoader order.
      Returns:
      Unmodifiable list, possibly empty.