Annotation Type RestInit
This method is called from within the Servlet.init(ServletConfig)
method after the RestContext.Builder
object has been created and initialized with the annotations defined on the class, but before the
RestContext
object has been created.
The only valid parameter type for this method is RestContext.Builder
which can be used to configure the servlet.
An example of this is the
Example:
Notes:
-
The method should return
void although if it does return any value, the value will be ignored. -
The method should be
public although other visibilities are valid if the security manager allows it. - Static methods can be used.
-
Multiple init methods can be defined on a class.
Init methods on parent classes are invoked before init methods on child classes.
The order of init method invocations within a class is alphabetical, then by parameter count, then by parameter types. - The method can throw any exception causing initialization of the servlet to fail.
-
Note that if you override a parent method, you probably need to call
.super .parentMethod(...)
The method is still considered part of the parent class for ordering purposes even though it's overridden by the child class.
See Also:
-
Optional Element Summary
-
Element Details
-
on
Dynamically apply this annotation to the specified methods.See Also:
- Returns:
- The annotation value.
- Default:
- {}
-