Class Prelude


public final class Prelude extends Object
Represents the prelude model available to every Smithy model.

The prelude consists of public prelude shapes like smithy.api#String and traits that are available to all models like box and required.

A key design requirement of the prelude is that it cannot require a loaded prelude model in order to reason about the prelude as this would result in infinite recursion while loading the prelude model.

  • Field Details

  • Method Details

    • isPreludeShape

      public static boolean isPreludeShape(ToShapeId id)
      Checks if the given shape ID is defined by the prelude.

      Specifically, this checks if the namespace of the provided shape ID is equal to smithy.api.

      id - Shape ID to check.
      Returns true if the shape is a prelude shape.
    • isPublicPreludeShape

      public static boolean isPublicPreludeShape(ToShapeId id)
      Checks if the given shape is a public shape or trait defined by the prelude.
      id - Shape to check.
      Returns true if the shape is a public prelude shape.