List of usage examples for java.util Locale ENGLISH
Locale ENGLISH
To view the source code for java.util Locale ENGLISH.
Click Source Link
From source file:it.unibo.alchemist.SupportedIncarnations.java
private static String preprocess(final String s) { return s.toLowerCase(Locale.ENGLISH).replace("incarnation", ""); }
From source file:org.xeneo.web.beans.ActivityStreamBeanTest.java
@Test public void testFormat() { String message = ms.getMessage("message1", null, Locale.ENGLISH); message += ms.getMessage("message2", null, Locale.ENGLISH); message += ms.getMessage("message3", null, Locale.ENGLISH); // asb.formatActivity("http://activitystrea.ms/schema/1.0/add", new Actor("http://test.xeneo.org/test-actor","Test Actor","..."), new Object("http://somewhere.com","Object Name",ObjectTypes.bookmark.URI), new Object("http://something.com","Target Name",ObjectTypes.tag.URI)); // asb.formatActivity(Actions.add.URI, new Actor("http://test.xeneo.org/test-actor","Test Actor","..."), new Object("http://somewhere.com","Object Name",ObjectTypes.bookmark.URI), new Object()); logger.info(message);/*from w w w .ja va2s . c o m*/ }
From source file:fr.hoteia.qalingo.core.service.impl.ReferentialDataServiceImpl.java
public Map<String, String> getTitlesByLocale(final Locale locale) { Map<String, String> titlesMapByLocale = titlesByLocale.get(locale); if (titlesMapByLocale == null) { ResourceBundle titlesBundleByLocale = getTitlesBundleByLocale(locale); if (titlesBundleByLocale != null) { titlesByLocale.put(locale, buildMap(titlesBundleByLocale)); titlesMapByLocale = titlesByLocale.get(locale); } else {/*from w w w .j ava 2 s.c om*/ titlesMapByLocale = getTitlesByLocale(Locale.ENGLISH); } } return titlesMapByLocale; }
From source file:com.example.app.resource.service.ResourceCategoryLabelProvider.java
@Nonnull @Override/*from w w w.ja v a 2 s . c om*/ protected TransientLocalizedObjectKey getDefaultName() { TransientLocalizedObjectKey defaultName = new TransientLocalizedObjectKey(new HashMap<>()); defaultName.addLocalization(Locale.ENGLISH, "Category"); return defaultName; }
From source file:ca.nines.ise.cmd.Modernize.java
/** * {@inheritDoc}/* w w w. ja va2 s . co m*/ */ @Override public void execute(CommandLine cmd) throws Exception { PrintStream out; Writer renderer; Log log = Log.getInstance(); Locale.setDefault(Locale.ENGLISH); out = new PrintStream(System.out, true, "UTF-8"); if (cmd.hasOption("o")) { out = new PrintStream(new FileOutputStream(cmd.getOptionValue("o")), true, "UTF-8"); } renderer = new SGMLWriter(out); String[] files = getArgList(cmd); DOM dom = new DOMBuilder(new File(files[0])).build(); if (dom.getStatus() == DOMStatus.ERROR) { System.err.println("Document contains errors. Cannot continue."); if (log.count() > 0) { out.println(log); log.clear(); } System.exit(-1); } Schema schema = Schema.defaultSchema(); DOMValidator dv = new DOMValidator(); NestingValidator nv = new NestingValidator(schema); Modernizer m = new Modernizer(); Normalizer n = new Normalizer(); Formatter f = new Formatter(); dv.validate(dom, schema); nv.validate(dom); dom = m.transform(dom); dom = n.transform(dom); dom = f.transform(dom); renderer.render(dom); }
From source file:org.ega_archive.elixircore.filter.CustomHiddenHttpMethodFilter.java
@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { String paramValue = request.getParameter(this.methodParam); if (("POST".equals(request.getMethod()) || "GET".equals(request.getMethod())) && StringUtils.hasLength(paramValue)) { String method = paramValue.toUpperCase(Locale.ENGLISH); HttpServletRequest wrapper = new HttpMethodRequestWrapper(request, method); filterChain.doFilter(wrapper, response); } else {/*from w ww .j av a 2s .c o m*/ filterChain.doFilter(request, response); } }
From source file:ca.nines.ise.cmd.Transform.java
/** * {@inheritDoc}// w w w. ja v a 2 s. co m */ @Override public void execute(CommandLine cmd) throws Exception { PrintStream out; Locale.setDefault(Locale.ENGLISH); out = new PrintStream(System.out, true, "UTF-8"); if (cmd.hasOption("o")) { out = new PrintStream(new FileOutputStream(cmd.getOptionValue("o")), true, "UTF-8"); } Log log = Log.getInstance(); Writer renderer = null; if (cmd.hasOption("text")) { renderer = new TextWriter(out); } if (cmd.hasOption("xml")) { renderer = new XMLWriter(out); } if (cmd.hasOption("rtf")) { renderer = new RTFWriter(out); } if (cmd.hasOption("sgml")) { renderer = new SGMLWriter(out); } if (cmd.hasOption("ximl")) { renderer = new ExpandedSGMLWriter(out); } if (renderer == null) { System.err.println("You must specify a transformation"); System.exit(1); return; } String[] files = getArgList(cmd); DOM dom = new DOMBuilder(new File(files[0])).build(); Schema schema = Schema.defaultSchema(); DOMValidator dv = new DOMValidator(); NestingValidator nv = new NestingValidator(schema); dv.validate(dom, schema); nv.validate(dom); if (dom.getStatus() != DOMStatus.ERROR) { if (files.length == 2) { Annotation ann = Annotation.builder().from(new File(files[1])).build(); renderer.render(dom, ann); } else { renderer.render(dom); } } else { Message m = Message.builder("dom.errors").setSource(dom.getSource()).build(); log.add(m); } if (log.count() > 0) { System.err.println(log.count() + " errors or warnings."); System.err.println(log); } log.clear(); }
From source file:com.nike.cerberus.validation.IamRolePermissionsValidator.java
private String buildKey(IamRolePermission iamRolePermission) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(StringUtils.lowerCase(iamRolePermission.getAccountId(), Locale.ENGLISH)); stringBuilder.append('-'); stringBuilder.append(StringUtils.lowerCase(iamRolePermission.getIamRoleName(), Locale.ENGLISH)); return stringBuilder.toString(); }
From source file:com.wealdtech.utils.EnvironmentType.java
@Override @JsonValue public String toString() { return StringUtils.capitalize(super.toString().toLowerCase(Locale.ENGLISH)); }
From source file:ch.ralscha.extdirectspring.util.SupportedParametersTest.java
@Test public void testResolveParameter() { MockHttpServletRequest request = new MockHttpServletRequest("POST", "/action/api-debug.js"); MockHttpServletResponse response = new MockHttpServletResponse(); Locale en = Locale.ENGLISH; assertThat(SupportedParameters.resolveParameter(String.class, request, response, en)).isNull(); assertThat(SupportedParameters.resolveParameter(MockHttpServletRequest.class, request, response, en)) .isSameAs(request);//from ww w.ja v a 2 s.c o m assertThat(SupportedParameters.resolveParameter(MockHttpSession.class, request, response, en)) .isSameAs(request.getSession()); assertThat(SupportedParameters.resolveParameter(Principal.class, request, response, en)) .isSameAs(request.getUserPrincipal()); assertThat(SupportedParameters.resolveParameter(MockHttpServletResponse.class, request, response, en)) .isSameAs(response); assertThat(SupportedParameters.resolveParameter(Locale.class, request, response, en)).isSameAs(en); SSEWriter sseWriter = new SSEWriter(response); assertThat(SupportedParameters.resolveParameter(SSEWriter.class, request, response, en, sseWriter)) .isSameAs(sseWriter); }