public interface L10nPathCompilerI
Implementations of this interface provide a mechanism to transform a participant into path elements for the L10n resource lookup process. This allows for customization of the lookup path based on the specific context or requirements.
Example 1: The LesezeichenPathCompiler
takes a Lesezeichen
as a participant
for compiling the path elements. If the Lesezeichen
defines a BO type it applies to, the
Class
represented by that BO type is returned, together with the Lesezeichen
class
itself.
Example 2: The BOT.BOClassesPathCompiler
calculates the path elements from a BO
Class
by determining all other classes "belonging" to the same entity, such as aspect classes
from modules or within a project and the generated base class. This ensures that looking up the l10n
packs for translations in the context of that BO type works correctly.
Modifier and Type | Field and Description |
---|---|
static L10nPathCompilerI[] |
EMPTY_ARRAY
An empty array of L10nPathCompilerI-s.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
compileParticipantToPathElements(java.lang.Object participant)
Compiles the path elements to use for a participant within the localization (L10n) lookup.
|
boolean |
isValidParticipant(java.lang.Object participant)
Checks if the given participant is a valid input for this path compiler.
|
static final L10nPathCompilerI[] EMPTY_ARRAY
boolean isValidParticipant(java.lang.Object participant)
participant
- The Object
to validate.true
if the participant is valid, false
otherwise.java.lang.Object[] compileParticipantToPathElements(java.lang.Object participant)
This method transforms a participant Object
into an array of path elements, which are
used to determine the lookup path for L10n resources. The returned elements should not contain
strings, as string processing occurs at the end of the lookup process in
L10n#addStringParticipant
. The order of elements in the returned array is significant
for localization lookup precedence.
participant
- The participant Object
to compile.Object
s (typically Class
objects) representing the path elements.
This array is used by the L10n system to search for localized resources.Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.