Example usage for java.util Locale GERMANY

List of usage examples for java.util Locale GERMANY

Introduction

In this page you can find the example usage for java.util Locale GERMANY.

Prototype

Locale GERMANY

To view the source code for java.util Locale GERMANY.

Click Source Link

Document

Useful constant for country.

Usage

From source file:org.mili.core.resource.ResourceUtilImpl.java

private void loadDevResources(Locale locale, URL url, String realBaseName, String baseName) {
    if ((locale.equals(Locale.GERMAN) || locale.equals(Locale.GERMANY)) && url != null) {
        InputStream is = null;//w ww  .j av  a2 s .com
        try {
            is = FileUtil.getInputStream(url.getPath() + "/" + baseName + "_dev.properties");
            copyPropertiesInResMap(PropUtil.readProperties(is), realBaseName, locale);
        } catch (Exception e) {
            // eat it
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) { // eat it!
                }
            }
        }
    }
}

From source file:org.openestate.io.idx.IdxFormat.java

public static Number parseNumber(String value, boolean integerOnly) throws NumberFormatException {
    return NumberUtils.parseNumber(value, integerOnly, Locale.ENGLISH, Locale.GERMANY);
}

From source file:org.openestate.io.is24_csv.Is24CsvFormat.java

public static String printNumber(Number value, int integerDigits, int fractionDigits) {
    return NumberUtils.printNumber(value, integerDigits, fractionDigits, Locale.GERMANY);
}

From source file:org.polymap.rhei.field.DateTimeFormField.java

public IFormField setValue(Object value) {
    Date date = (Date) value;
    Calendar cal = Calendar.getInstance(Locale.GERMANY);
    cal.setTime(date);/*  w  w w .  ja va2s.  com*/

    // modify the orig value; otherwise millis may differ as DateTime field
    // does not support millis
    cal.set(Calendar.MILLISECOND, 0);
    date.setTime(cal.getTimeInMillis());

    datetime.setDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE));
    datetime.setTime(cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));

    // the above calls does not seem to fire events
    site.fireEvent(DateTimeFormField.this, IFormFieldListener.VALUE_CHANGE,
            loadedValue == null && date.equals(nullValue) ? null : date);
    return this;
}

From source file:com.squarespace.template.CompilerTest.java

@Test
public void testLocale() throws CodeException {
    Context ctx = COMPILER.newExecutor().template("{@|date %B}")
            .json("{\"website\":{\"timeZone\":\"UTC\"},\"now\": 1}").locale(Locale.GERMANY).execute();
    assertEquals(ctx.buffer().toString(), "Januar");
}

From source file:com.mobileman.projecth.business.patient.PatientMedicationServiceTest.java

/**
 * /*from   w w w  . j  ava 2s. com*/
 * @throws Exception
 */
@Test
public void addConsumedMedicationBiWeekly() throws Exception {

    int oldSize = patientMedicationDao.findAll().size();

    Patient patient = (Patient) userService.findUserByLogin("sysuser1");
    assertNotNull(patient);
    Medication medication = medicationService.findByName("Kort 2", Locale.GERMANY).get(0);

    Disease disease = diseaseService.findByCode(DiseaseCodes.RHEUMA_CODE);
    assertNotNull(disease);

    DateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy");
    Date startDate = dateFormat.parse("1.11.2010");
    Date endDate = dateFormat.parse("28.11.2010");

    patientMedicationService.addConsumedMedication(patient.getId(), disease.getId(), medication.getId(), 2.0d,
            MedicationFrequency.BI_WEEKLY, startDate, endDate, null);
    assertEquals(oldSize + 2, patientMedicationDao.findAll().size());

}

From source file:org.projectforge.humanresources.HRPlanningDao.java

@SuppressWarnings("unchecked")
public HRPlanningDO getEntry(final Integer userId, final Date week) {
    final DateHolder date = new DateHolder(week, DateHelper.UTC, Locale.GERMANY);
    if (date.isBeginOfWeek() == false) {
        log.error("Date is not begin of week, try to change date: " + DateHelper.formatAsUTC(date.getDate()));
        date.setBeginOfWeek();/*from  w w w .  java  2s  . com*/
    }
    final List<HRPlanningDO> list = getHibernateTemplate().find(
            "from HRPlanningDO p where p.user.id = ? and p.week = ?",
            new Object[] { userId, date.getSQLDate() });
    if (list == null || list.size() != 1) {
        return null;
    }
    final HRPlanningDO planning = list.get(0);
    if (accessChecker.hasLoggedInUserSelectAccess(userRightId, planning, false) == true) {
        return planning;
    } else {
        return null;
    }
}

From source file:org.openestate.io.examples.ImmoXmlWritingExample.java

/**
 * Create an {@link Immobilie} with some example data.
 *
 * @return/*from  w  w  w .jav  a  2s . com*/
 * created example object
 */
protected static Immobilie createImmobilie() {
    // create an example real estate
    Immobilie immobilie = FACTORY.createImmobilie();

    // add some administrative informations
    immobilie.setVerwaltungTechn(FACTORY.createVerwaltungTechn());
    immobilie.getVerwaltungTechn().setAktion(FACTORY.createAktion());
    immobilie.getVerwaltungTechn().getAktion().setAktionart(Aktion.AktionArt.CHANGE);
    immobilie.getVerwaltungTechn().setObjektnrIntern(RandomStringUtils.randomNumeric(10));

    // set categorization
    immobilie.setObjektkategorie(FACTORY.createObjektkategorie());
    immobilie.getObjektkategorie().setNutzungsart(FACTORY.createNutzungsart());
    immobilie.getObjektkategorie().getNutzungsart().setANLAGE(RandomUtils.nextInt(0, 2) == 1);
    immobilie.getObjektkategorie().getNutzungsart().setGEWERBE(RandomUtils.nextInt(0, 2) == 1);
    immobilie.getObjektkategorie().getNutzungsart().setWAZ(RandomUtils.nextInt(0, 2) == 1);
    immobilie.getObjektkategorie().getNutzungsart().setWOHNEN(RandomUtils.nextInt(0, 2) == 1);
    immobilie.getObjektkategorie().setVermarktungsart(FACTORY.createVermarktungsart());
    immobilie.getObjektkategorie().getVermarktungsart().setKAUF(true);
    immobilie.getObjektkategorie().setObjektart(FACTORY.createObjektart());

    Haus singleFamilyHouse = FACTORY.createHaus();
    singleFamilyHouse.setHaustyp(Haus.Haustyp.EINFAMILIENHAUS);
    immobilie.getObjektkategorie().getObjektart().getHaus().add(singleFamilyHouse);

    // add some informations about the location
    immobilie.setGeo(FACTORY.createGeo());
    immobilie.getGeo().setPlz(RandomStringUtils.randomNumeric(5));
    immobilie.getGeo().setOrt("Berlin");
    immobilie.getGeo().setLand(FACTORY.createLand());
    immobilie.getGeo().getLand().setIsoLand(Locale.GERMANY.getISO3Country());

    // add some informations about prices
    immobilie.setPreise(FACTORY.createPreise());
    immobilie.getPreise().setHeizkosten(new BigDecimal("456.0"));
    immobilie.getPreise().setKaufpreis(new BigDecimal("123456.79"));

    // add some informations about features
    immobilie.setAusstattung(FACTORY.createAusstattung());
    immobilie.getAusstattung().setGartennutzung(true);
    immobilie.getAusstattung().setHeizungsart(FACTORY.createHeizungsart());
    immobilie.getAusstattung().getHeizungsart().setZENTRAL(true);
    immobilie.getAusstattung().getHeizungsart().setFUSSBODEN(true);

    // add some descriptions
    immobilie.setFreitexte(FACTORY.createFreitexte());
    immobilie.getFreitexte().setObjekttitel("A title for the property.");
    immobilie.getFreitexte().setObjektbeschreibung("Some longer descriptive text about the property.");

    // set the contact person
    immobilie.setKontaktperson(FACTORY.createKontaktperson());
    immobilie.getKontaktperson().setName("Max Mustermann");
    immobilie.getKontaktperson().setEmailDirekt("max@mustermann.org");
    immobilie.getKontaktperson().setTelDurchw("030/123456789");
    immobilie.getKontaktperson().setPlz(RandomStringUtils.randomNumeric(5));
    immobilie.getKontaktperson().setOrt("Berlin");
    immobilie.getKontaktperson().setLand(FACTORY.createLand());
    immobilie.getKontaktperson().getLand().setIsoLand(Locale.GERMANY.getISO3Country());

    return immobilie;
}

From source file:com.octo.captcha.engine.bufferedengine.manager.QuartzBufferedEngineManagerTest.java

public void testSetLocaleRatio() {
    manager.setLocaleRatio(Locale.GERMANY.toString(), 0.2);

    Map map = manager.getLocaleRatio();

    assertEquals(new Double(0.2), (Double) map.get(Locale.GERMANY));
}

From source file:org.projectforge.business.humanresources.HRPlanningDao.java

@SuppressWarnings("unchecked")
public HRPlanningDO getEntry(final Integer userId, final Date week) {
    final DateHolder date = new DateHolder(week, DateHelper.UTC, Locale.GERMANY);
    if (date.isBeginOfWeek() == false) {
        log.error("Date is not begin of week, try to change date: " + DateHelper.formatAsUTC(date.getDate()));
        date.setBeginOfWeek();/*from   w w  w  .  j a v  a 2  s .  c  o m*/
    }
    final List<HRPlanningDO> list = (List<HRPlanningDO>) getHibernateTemplate().find(
            "from HRPlanningDO p where p.user.id = ? and p.week = ?",
            new Object[] { userId, date.getSQLDate() });
    if (list == null || list.size() != 1) {
        return null;
    }
    final HRPlanningDO planning = list.get(0);
    if (accessChecker.hasLoggedInUserSelectAccess(userRightId, planning, false) == true) {
        return planning;
    } else {
        return null;
    }
}