Class Prelude
- java.lang.Object
-
- software.amazon.smithy.model.loader.Prelude
-
public final class Prelude extends java.lang.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 likebox
andrequired
.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 Summary
Fields Modifier and Type Field Description static java.lang.String
NAMESPACE
The Smithy prelude namespace.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPreludeShape(ToShapeId id)
Checks if the given shape ID is defined by the prelude.static boolean
isPublicPreludeShape(ToShapeId id)
Checks if the given shape is a public shape or trait defined by the prelude.
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
The Smithy prelude namespace.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
.- Parameters:
id
- Shape ID to check.- Returns:
- 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.- Parameters:
id
- Shape to check.- Returns:
- Returns true if the shape is a public prelude shape.
-
-