java.lang.Object
io.helidon.openapi.OpenApiUiBase
Common base class for implementations of @link OpenApiUi}.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOpenApiUiBase.Builder<B extends OpenApiUiBase.Builder<B,T>, T extends OpenApiUi> Common base builder implementation for creating a newOpenApiUi. -
Field Summary
Fields inherited from interface io.helidon.openapi.OpenApiUi
UI_WEB_SUBCONTEXT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOpenApiUiBase(OpenApiUiBase.Builder<?, ?> builder, Function<MediaType, String> documentPreparer, String openAPIWebContext) Creates a new UI implementation from the specified builder and document preparer. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanoptions()protected StringprepareDocument(MediaType mediaType) Prepares a representation of the OpenAPI document in the specified media type.protected booleansendStaticText(ServerRequest request, ServerResponse response, MediaType mediaType) Sends a static text response of the given media type.protected StringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.openapi.OpenApiUi
prepareTextResponseFromMainEndpoint, supportedMediaTypes
-
Constructor Details
-
OpenApiUiBase
protected OpenApiUiBase(OpenApiUiBase.Builder<?, ?> builder, Function<MediaType, String> documentPreparer, String openAPIWebContext) Creates a new UI implementation from the specified builder and document preparer.- Parameters:
builder- the builder containing relevant settingsdocumentPreparer- function returning an OpenAPI document represented as a specifiedMediaTypeopenAPIWebContext- final web context for theOpenAPISupportservice
-
-
Method Details
-
isEnabled
protected boolean isEnabled()- Returns:
- whether the UI is enabled
-
prepareDocument
Prepares a representation of the OpenAPI document in the specified media type.- Parameters:
mediaType- media type in which to express the document- Returns:
- representation of the OpenAPI document
-
webContext
- Returns:
- web context this UI implementation responds at
-
options
- Returns:
- options set for this UI implementation (unmodifiable)
-
sendStaticText
protected boolean sendStaticText(ServerRequest request, ServerResponse response, MediaType mediaType) Sends a static text response of the given media type.- Parameters:
request- the request to respond toresponse- the responsemediaType- theMediaTypewith which to respond, if possible- Returns:
- whether the implementation responded with a static text response
-