Class DebugEnablement
- Direct Known Subclasses:
BasicDebugEnablement
,DebugEnablement.Void
See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class.class
Represents no DebugEnablement. -
Constructor Summary
ConstructorDescriptionDebugEnablement
(BeanStore beanStore) Constructor.DebugEnablement
(DebugEnablement.Builder builder) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic DebugEnablement.Builder
Static creator.protected DebugEnablement.Builder
Initializer.protected boolean
isConditionallyEnabled
(jakarta.servlet.http.HttpServletRequest req) Returnstrue if debugging is conditionally enabled on the specified request.boolean
isDebug
(RestContext context, jakarta.servlet.http.HttpServletRequest req) Returnstrue if debug is enabled on the specified class and request.boolean
isDebug
(RestOpContext context, jakarta.servlet.http.HttpServletRequest req) Returnstrue if debug is enabled on the specified method and request.toString()
-
Constructor Details
-
DebugEnablement
Constructor.Subclasses typically override the
init(BeanStore)
method when using this constructor.- Parameters:
beanStore
- The bean store containing injectable beans for this enablement.
-
DebugEnablement
Constructor.- Parameters:
builder
- The builder for this enablement.
-
-
Method Details
-
create
Static creator.- Parameters:
beanStore
- The bean store to use for creating beans.- Returns:
- A new builder for this object.
-
init
Initializer.Subclasses should override this method to make modifications to the builder used to create this logger.
- Parameters:
beanStore
- The bean store containing injectable beans for this logger.- Returns:
- A new builder object.
-
isDebug
Returnstrue if debug is enabled on the specified class and request.This enables debug mode on requests once the matched class is found and before the Java method is found.
- Parameters:
context
- The context of theRest
-annotated class.req
- The HTTP request.- Returns:
true if debug is enabled on the specified method and request.
-
isDebug
Returnstrue if debug is enabled on the specified method and request.This enables debug mode after the Java method is found and allows you to enable debug on individual Java methods instead of the entire class.
- Parameters:
context
- The context of theRestOp
-annotated method.req
- The HTTP request.- Returns:
true if debug is enabled on the specified method and request.
-
isConditionallyEnabled
Returnstrue if debugging is conditionally enabled on the specified request.This method only gets called when the enablement value resolves to
CONDITIONAL
.Subclasses can override this method to provide their own implementation. The default implementation is provided by
DebugEnablement.Builder.conditional(Predicate)
which has a default predicate of .x ->"true" .equalsIgnoreCase(x .getHeader("Debug" )- Parameters:
req
- The incoming HTTP request.- Returns:
true if debugging is conditionally enabled on the specified request.
-
toString
-