]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.api.acr/src/org/argeo/api/acr/ldap/LdapAcrUtils.java
1 package org
.argeo
.api
.acr
.ldap
;
3 import java
.util
.Locale
;
5 import javax
.xml
.namespace
.QName
;
7 import org
.argeo
.api
.acr
.Content
;
8 import org
.argeo
.api
.acr
.ContentName
;
10 /** Utilities around ACR and LDAP conventions. */
11 public class LdapAcrUtils
{
14 private LdapAcrUtils() {
17 public static Object
getLocalized(Content content
, QName key
, Locale locale
) {
19 throw new IllegalArgumentException("A locale must be specified");
21 if (locale
.getCountry() != null && !locale
.getCountry().equals(""))
22 value
= content
.get(new ContentName(key
.getNamespaceURI(),
23 key
.getLocalPart() + ";lang-" + locale
.getLanguage() + "-" + locale
.getCountry()));
26 .get(new ContentName(key
.getNamespaceURI(), key
.getLocalPart() + ";lang-" + locale
.getLanguage()));
28 value
= content
.get(key
);