public class LocaleUtils extends Object
Constructor and Description |
---|
LocaleUtils(CdsModel model) |
Modifier and Type | Method and Description |
---|---|
boolean |
collateClauseIsNeeded(CqnFilterableStatement statement,
Locale locale)
Checks whether a given
CqnStatement needs to be appended with a
collate clause |
static String |
getLocaleString(Locale locale)
Calculates the locale String value from a specific locale that can be used to
access localized attributes fields
|
static boolean |
hasLocalizedElements(CdsStructuredType targetType,
Collection<CqnElementRef> elementRefs)
Checks if some element refs of a structured type has any localized elements
|
static boolean |
isLocalized(CdsEntity entity)
Checks if an entity is annotated with @cds.localized
|
static boolean |
isLocalizedEntityName(String entity)
Checks if a given entity name is a localized entity name
|
static String |
localeSpecificViewName(String entity,
Locale locale)
Calculates the locale-specific view name for a given locale, which can be
used to access localized fields
|
static String |
localizedEntityName(CdsEntity entity)
Calculates the localized entity name that can be used to access localized
fields
|
static String |
localizedEntityName(String entity)
Calculates the localized entity name that can be used to access localized
fields
|
public LocaleUtils(CdsModel model)
public static String localizedEntityName(CdsEntity entity)
entity
- the entitypublic static String localizedEntityName(String entity)
entity
- the entity namepublic static String localeSpecificViewName(String entity, Locale locale)
entity
- the entity namelocale
- the localepublic static boolean isLocalizedEntityName(String entity)
entity
- the entity namepublic static String getLocaleString(Locale locale)
locale
- the localepublic static boolean isLocalized(CdsEntity entity)
entity
- the entity to be checkedpublic static boolean hasLocalizedElements(CdsStructuredType targetType, Collection<CqnElementRef> elementRefs)
targetType
- the structured type to be checked for localized elementselementRefs
- the element refs to be checkedpublic boolean collateClauseIsNeeded(CqnFilterableStatement statement, Locale locale)
CqnStatement
needs to be appended with a
collate clausestatement
- the statement to be checkedlocale
- the Locale
provided along the statement executionCopyright © 2023 SAP. All rights reserved.