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:de.tbuchloh.kiskis.persistence.importer.CSVImportTest.java
/** * {@inheritDoc}/*from ww w . jav a 2s.com*/ */ @Override protected void setUp() throws Exception { super.setUp(); _locale = Locale.getDefault(); Locale.setDefault(Locale.ENGLISH); }
From source file:de.tudarmstadt.ukp.argumentation.data.roomfordebate.NYTimesArticleExtractor.java
public Article extractArticle(String html) throws ParseException, IOException { Article result = new Article(); Document doc = Jsoup.parse(html, getBaseName()); Element element;/*from w w w . j a v a 2 s . c o m*/ try { element = doc.select("article.rfd").iterator().next(); } catch (NoSuchElementException exception) { throw new IOException("Cannot find article.rfd element"); } // System.out.println(element); String dateText = element.select("p.pubdate").text().replaceAll("Updated[\\s]+", ""); // time try { DateFormat df = new SimpleDateFormat("MMM dd, yyyy, hh:mm aaa", Locale.ENGLISH); Date date = df.parse(dateText); result.setTimestamp(date); } catch (ParseException e) { // June 24, 2015 DateFormat df = new SimpleDateFormat("MMM dd, yyyy", Locale.ENGLISH); Date date = df.parse(dateText); result.setTimestamp(date); } // title result.setTitle(TextCleaningUtils.normalizeWithParagraphs(element.select("h1").text())); // text StringBuilder sb = new StringBuilder(); for (Element p : element.select("div.nytint-post > p")) { sb.append(p.text()); sb.append("\n"); } result.setText(TextCleaningUtils.normalizeWithParagraphs(sb.toString())); // debate title result.setDebateTitle(TextCleaningUtils .normalizeWithParagraphs(doc.select("div.nytint-discussion-overview > h2").text())); // debate url result.setDebateUrl(doc.select("div.nytint-discussion-overview > h2 > a").iterator().next().attr("href")); // document url result.setUrl(doc.select("meta[name=communityAssetURL]").attr("content")); // debate description result.setDebateDescription(TextCleaningUtils .normalizeWithParagraphs(((TextNode) doc.select("div.nytint-discussion-overview > p").iterator() .next().childNodes().iterator().next()).text())); // aurhor result.setAuthor(element.select("div.nytint-mugshots > img").iterator().next().attr("alt")); // topics for (Element a : element.select("p.nytint-tags > a")) { result.getTopics().add(a.attr("href")); } return result; }
From source file:net.sf.dynamicreports.test.jasper.chart.GroupedStackedBarChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(//from w ww .ja va 2 s . c om cht.groupedStackedBarChart().setCategory(column1) .series(cht.groupedSerie(column2).setSeries(column1).setGroup(column1)) .setShowLabels(true).setShowTickLabels(false).setShowTickMarks(false), cht.stackedBarChart().setCategory(column1) .series(cht.groupedSerie(column2).setSeries(column1).setGroup(column1)) .setCategoryAxisFormat(cht.axisFormat().setLabel("category") .setLabelColor(Color.BLUE).setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d) .setLineColor(Color.LIGHT_GRAY)), cht.stackedBarChart().setCategory(column1) .series(cht.groupedSerie(column2).setSeries(column1).setGroup(column1)) .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00") .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1) .setRangeMaxValueExpression(15))); }
From source file:org.web4thejob.orm.ListSerializationTest.java
@Test public void localesListTest() throws IOException { final Marshaller marshaller = ContextUtil.getBean(Marshaller.class); Assert.assertNotNull(marshaller);/*from www .j av a 2s . c o m*/ List<Locale> locales = new ArrayList<Locale>(); locales.add(Locale.CANADA); locales.add(Locale.CHINA); locales.add(Locale.ENGLISH); final ByteArrayOutputStream out = new ByteArrayOutputStream(); final Result result = new StreamResult(out); marshaller.marshal(locales, result); System.out.println(out.toString("UTF-8")); }
From source file:fr.treeptik.cloudunit.utils.CheckUtils.java
/** * Valid Classic + Syntax input/*from ww w . ja v a 2s . co m*/ * * @param field * @param message * @throws CheckException */ public static void validateSyntaxInput(String field, String message) throws CheckException { if (field == null || field.trim().length() == 0 || "undefined".equals(field) || field.length() > 15 || !StringUtils.isAlphanumeric(field)) { String messageTranslated = messageSource.getMessage(message, null, Locale.ENGLISH); throw new CheckException(messageTranslated); } }
From source file:caillou.company.clonemanager.gui.customComponent.settings.SettingsController.java
@Override public void initialize(URL location, ResourceBundle resources) { languageComboBoxId.setCellFactory(new Callback<ListView<Language>, ListCell<Language>>() { @Override/*from ww w . java 2 s . co m*/ public ListCell<Language> call(ListView<Language> language) { return new LanguageListCell(); } }); languageComboBoxId.setButtonCell(new LanguageListCell()); Language frenchLanguage = new Language(Locale.FRENCH); Language englishLanguage = new Language(Locale.ENGLISH); ObservableList<Language> languages = FXCollections.observableArrayList(); languages.add(englishLanguage); languages.add(frenchLanguage); languageComboBoxId.setItems(languages); Locale currentLocale = SpringFxmlLoader.getLocale(); if (currentLocale.equals(Locale.FRENCH)) { languageComboBoxId.setValue(frenchLanguage); } else { languageComboBoxId.setValue(englishLanguage); } languageComboBoxId.valueProperty().addListener(new ChangeListener<Language>() { @Override public void changed(ObservableValue<? extends Language> observable, Language oldValue, Language newValue) { SpringFxmlLoader.changeLocale(newValue.getLocale()); } }); }
From source file:eu.trentorise.smartcampus.test.SocialEngineOperation.java
@PostConstruct @SuppressWarnings("unused") private void init() { client = SCWebApiClient.getInstance(Locale.ENGLISH, seHost, sePort); }
From source file:ca.nines.ise.cmd.Wikify.java
/** * {@inheritDoc}//from www .j a va 2 s . co m */ @Override public void execute(CommandLine cmd) throws Exception { Locale.setDefault(Locale.ENGLISH); PrintStream out = new PrintStream(System.out, true, "UTF-8"); if (cmd.hasOption("o")) { out = new PrintStream(new FileOutputStream(cmd.getOptionValue("l")), true, "UTF-8"); } if (cmd.hasOption("chars")) { wikifyCharacters(out); } if (cmd.hasOption("schema")) { wikifySchema(out); } if (cmd.hasOption("codepoints")) { wikifyCodepoints(out); } }
From source file:net.sf.jabref.logic.journals.JournalAbbreviationRepository.java
public boolean isAbbreviatedName(String journalName) { String nameKey = Objects.requireNonNull(journalName).trim().toLowerCase(Locale.ENGLISH); return (isoLowerCase2Abbreviation.containsKey(nameKey)) || (medlineLowerCase2Abbreviation.containsKey(nameKey)); }
From source file:de.perdian.commons.lang.conversion.impl.converters.TestDateToStringConverter.java
@Test public void testConvertWithPatternAndLocaleEN() { Date sourceDate = new Date(1362736759873L); DateToStringConverter converter = new DateToStringConverter("EEEE", new SimpleLocaleContext(Locale.ENGLISH)); Assert.assertEquals("Friday", converter.convert(sourceDate)); }