{title:'RestOpContext', created:'9.0.0'}

The {@link oajr.RestOpContext} object is the workhorse class for an individual {@link oajr.annotation.RestOp}-annotated method.

Every class annotated with @RestOp ends up with an instance of this object. Similar to {@link oajr.RestContext}, the object is read-only and unchangeable and is initialized with all of the various annotations pulled from the method. All functionality available through annotations have programmatic equivalents through the builder of this class.

To access the builder for these objects, simply implement the following init method that will be called for each {@link oajr.annotation.RestOp}-annotated method.

| // Use an init hook with RestOpContext.Builder as a parameter. | @RestInit | public void init(RestOpContext.Builder builder) throws Exception { | builder | .beanContext(x -> x.swaps(TemporalCalendarSwap.Rfc1123DateTime.class)) | .debugEnablement(CONDITIONAL); | }

There are multiple ways to programmatically alter how RestOpContext behaves. The most straightforward are the following builder methods which are direct equivalents to values defined on the {@link oaj.rest.annotation.RestOp} annotation:

For more complex configurations, access to sub-builders is provided via the following methods: