Package org.codelibs.fess.util
Class WebApiUtil
java.lang.Object
org.codelibs.fess.util.WebApiUtil
Utility class for web API operations.
Provides functionality for setting and retrieving objects from request attributes,
error handling, and validation in web API context.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TGets an object from the current request attributes.static voidSets an error in the current request with the specified status code and exception.static voidSets an error in the current request with the specified status code and message.static voidSets an object in the current request attributes.static voidvalidate()Validates the current request by checking for stored web API exceptions.
-
Method Details
-
setObject
Sets an object in the current request attributes.- Parameters:
name- The attribute namevalue- The attribute value
-
getObject
Gets an object from the current request attributes.- Type Parameters:
T- The type of the object- Parameters:
name- The attribute name- Returns:
- The attribute value, or null if not found
-
setError
Sets an error in the current request with the specified status code and message.- Parameters:
statusCode- The HTTP status codemessage- The error message
-
setError
Sets an error in the current request with the specified status code and exception.- Parameters:
statusCode- The HTTP status codee- The exception that caused the error
-
validate
public static void validate()Validates the current request by checking for stored web API exceptions. Throws any stored WebApiException if found.- Throws:
WebApiException- If a web API exception was previously stored
-