本文整理汇总了Java中sun.util.locale.LanguageTag.UNDETERMINED属性的典型用法代码示例。如果您正苦于以下问题:Java LanguageTag.UNDETERMINED属性的具体用法?Java LanguageTag.UNDETERMINED怎么用?Java LanguageTag.UNDETERMINED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sun.util.locale.LanguageTag
的用法示例。
在下文中一共展示了LanguageTag.UNDETERMINED属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDataAccessForm
@GET
@Path("/form")
@Timed
public Mica.DataAccessFormDto getDataAccessForm(@QueryParam("lang") String lang) {
Optional<DataAccessForm> d = dataAccessFormService.find();
if(!d.isPresent()) throw NoSuchDataAccessFormException.withDefaultMessage();
DataAccessForm dataAccessForm = d.get();
Mica.DataAccessFormDto.Builder builder = Mica.DataAccessFormDto.newBuilder(dtos.asDto(dataAccessForm))
.clearProperties().clearPdfTemplates();
String langTag = !Strings.isNullOrEmpty(lang) ? Locale.forLanguageTag(lang).toLanguageTag() : LanguageTag.UNDETERMINED;
Map<String, LocalizedString> properties = dataAccessForm.getProperties().entrySet().stream()
.map(e -> Maps.immutableEntry(e.getKey(), new LocalizedString().forLanguageTag(langTag, e.getValue().get(langTag))))
.collect(toMap(Map.Entry::getKey, Map.Entry::getValue));
builder.addAllProperties(dtos.asDtoList(properties));
return builder.build();
}
示例2: getPdf
@GET
@Timed
@Path("/_pdf")
public Response getPdf(@PathParam("id") String id, @QueryParam("lang") String lang) {
subjectAclService.checkPermission("/data-access-request", "VIEW", id);
if(Strings.isNullOrEmpty(lang)) lang = LanguageTag.UNDETERMINED;
return Response.ok(dataAccessRequestService.getRequestPdf(id, lang))
.header("Content-Disposition", "attachment; filename=\"" + "data-access-request-" + id + ".pdf" + "\"").build();
}
示例3: put
@Override
public String put(@Nullable String locale, String value) {
if(Strings.isNullOrEmpty(value)) return null;
return super.put(locale == null ? LanguageTag.UNDETERMINED : Locale.forLanguageTag(locale).toLanguageTag(), value);
}