Package io.muserver.rest
Class SchemaObjectCustomizerContext
- java.lang.Object
-
- io.muserver.rest.SchemaObjectCustomizerContext
-
public class SchemaObjectCustomizerContext extends java.lang.Object
Provides the context that aSchemaObject
is in when customizing the schema in aSchemaObjectCustomizer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.MediaType
mediaType()
java.util.Optional<java.lang.reflect.Method>
methodHandle()
java.util.Optional<java.lang.reflect.Type>
parameterizedType()
java.util.Optional<java.lang.String>
parameterName()
java.lang.Object
resource()
For normal resources, this is the instance passed to theRestHandlerBuilder
.SchemaObjectCustomizerTarget
target()
java.lang.String
toString()
java.lang.Class<?>
type()
-
-
-
Method Detail
-
target
public SchemaObjectCustomizerTarget target()
- Returns:
- The type of object being described, e.g. a request body or response body.
-
resource
public java.lang.Object resource()
For normal resources, this is the instance passed to theRestHandlerBuilder
. Note that for sub-resources returned by a sub-resource-locator, this will be null.- Returns:
- The rest resource that creates or consumes the object being described
-
methodHandle
public java.util.Optional<java.lang.reflect.Method> methodHandle()
- Returns:
- The java method that builds or consumes the object being described
-
parameterName
public java.util.Optional<java.lang.String> parameterName()
- Returns:
- Where
target()
isSchemaObjectCustomizerTarget.FORM_PARAM
, this returns the form parameter name.
-
type
public java.lang.Class<?> type()
- Returns:
- The java type of the object being described
-
parameterizedType
public java.util.Optional<java.lang.reflect.Type> parameterizedType()
- Returns:
- For generic types, this is the generic type parameter
-
mediaType
public jakarta.ws.rs.core.MediaType mediaType()
- Returns:
- The media type of the schema being described
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-