Interface ProblemLocalizationStrategy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Problem.getTitle() / Problem.getDetail() (and any other
human-readable fields) before serialization.
The default in-tree implementation is IDENTITY — a pass-through that returns the input unchanged.
Server-side wiring consults the resource's bean store for a registered ProblemLocalizationStrategy bean,
and falls back to IDENTITY when none is registered, so the seam is invisible at zero cost on the hot
path until a deliberate strategy is contributed.
Status
This interface is shipped in juneau-bean-rfc7807 as the future-work hook for an eventual
Messages-driven (resource-bundle) translation pass. The reference Messages integration is
intentionally out of scope for the v1 RFC 7807 server wiring; the no-op IDENTITY default keeps the
call site stable so a future implementation can be dropped in without changing the processor contract.
Example
See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ProblemLocalizationStrategyDefault no-op strategy. -
Method Summary
-
Field Details
-
IDENTITY
Default no-op strategy. Returns the inputProblemunchanged.The server-side processor uses this constant as the fallback whenever no
ProblemLocalizationStrategybean is registered with the resource. Implementations that need to opt out of localization for a specificProblemcan return this constant's behavior by simply returning the input.
-
-
Method Details
-
localize
Translates the suppliedProblemfor the givenLocale.Implementations may mutate and return the input
Problem, or return a fresh bean — the processor treats the return value as the bean to serialize. Anullreturn is treated as "no opinion" and the original (pre-localization)Problemis used instead.
-