Example usage for java.util Locale GERMAN

List of usage examples for java.util Locale GERMAN

Introduction

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

Prototype

Locale GERMAN

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

Click Source Link

Document

Useful constant for language.

Usage

From source file:io.neba.core.selftests.SelftestReference.java

private String toIdentifierPart(String s) {
    String part = s.toLowerCase(Locale.GERMAN);
    return this.nonAsciiCharacters.matcher(part).replaceAll("-");
}

From source file:de.hybris.platform.solrfacetsearch.integration.IndexFullProductTest.java

@Before
public void before() throws Exception {

    final FlexibleSearchQuery flexibleSearchQuery = new FlexibleSearchQuery("select {PK} from {Product}");
    addIndexedCatalogVersionToQuery(flexibleSearchQuery);
    searchResult = flexibleSearchService.search(flexibleSearchQuery);

    solrServer = getSolrService().getSolrServer(facetSearchConfig.getSolrConfig(), indexedType);

    enLocale = Locale.ENGLISH;/*from   w  w  w . jav a  2 s.co  m*/
    deLocale = Locale.GERMAN;
}

From source file:com.salesmanager.core.module.impl.application.currencies.EURCurrencyModule.java

public String getFormatedAmount(BigDecimal amount) throws Exception {

    NumberFormat nf = null;//from w  w  w.j  a va  2  s .c om

    nf = NumberFormat.getInstance(Locale.GERMAN);

    nf.setMaximumFractionDigits(2);
    nf.setMinimumFractionDigits(2);

    return nf.format(amount);

}

From source file:org.businessmanager.web.controller.page.admin.SettingsController.java

public List<SelectItem> getAvailableLanguages() {
    Locale language = getCurrentLocale();

    String german = Locale.GERMAN.getDisplayLanguage(language);
    String english = Locale.ENGLISH.getDisplayLanguage(language);

    List<SelectItem> aSelectItemsList = new ArrayList<SelectItem>();
    aSelectItemsList.add(new SelectItem(Locale.GERMAN.getLanguage(), german));
    aSelectItemsList.add(new SelectItem(Locale.ENGLISH.getLanguage(), english));
    return aSelectItemsList;
}

From source file:de.fhg.iais.commons.fs.FileSystemScanner.java

private boolean patternAccept(File file) {
    if (this.patterns.length == 0) {
        return true;
    }//from ww  w .  ja  v a 2 s.co m
    String f = file.getName().toLowerCase(Locale.GERMAN);
    for (Pattern p : this.patterns) {
        if (p.matcher(f).matches()) {
            return true;
        }
    }
    return false;
}

From source file:org.techytax.helper.AmountHelper.java

public static BigInteger parse(String amount) throws ParseException {
    if (StringUtils.isEmpty(amount)) {
        return null;
    }//from   w w w  . j a  v a 2s.  c o m
    DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.GERMAN);
    otherSymbols.setDecimalSeparator(',');
    otherSymbols.setGroupingSeparator('.');
    DecimalFormat df = new DecimalFormat("###,###,###,##0", otherSymbols);
    return BigInteger.valueOf(df.parse(amount).intValue());
}

From source file:com.salesmanager.core.module.impl.application.currencies.GenericCurrencyModule.java

public BigDecimal getAmount(String amount) throws Exception {

    // validations
    /**/*w w w.j a  v a2 s .co m*/
     * 1) remove decimal and thousand
     * 
     * String.replaceAll(decimalPoint, ""); String.replaceAll(thousandPoint,
     * "");
     * 
     * Should be able to parse to Integer
     */
    StringBuffer newAmount = new StringBuffer();
    for (int i = 0; i < amount.length(); i++) {
        if (amount.charAt(i) != decimalPoint && amount.charAt(i) != thousandPoint) {
            newAmount.append(amount.charAt(i));
        }
    }

    try {
        Integer.parseInt(newAmount.toString());
    } catch (Exception e) {
        throw new ValidationException("Cannot parse " + amount);
    }

    if (!amount.contains(Character.toString(decimalPoint))
            && !amount.contains(Character.toString(thousandPoint)) && !amount.contains(" ")) {

        if (CurrencyModuleUtil.matchPositiveInteger(amount)) {
            BigDecimalValidator validator = CurrencyValidator.getInstance();
            BigDecimal bdamount = validator.validate(amount, Locale.US);
            if (bdamount == null) {
                throw new ValidationException("Cannot parse " + amount);
            } else {
                return bdamount;
            }
        } else {
            throw new ValidationException("Not a positive integer " + amount);
        }

    } else {

        StringBuffer pat = new StringBuffer();

        if (!StringUtils.isBlank(Character.toString(thousandPoint))) {
            pat.append("\\d{1,3}(" + thousandPoint + "?\\d{3})*");
        }

        pat.append("(\\" + decimalPoint + "\\d{1," + decimalCount + "})");

        Pattern pattern = Pattern.compile(pat.toString());

        Matcher matcher = pattern.matcher(amount);

        if (matcher.matches()) {

            Locale locale = Locale.US;

            if (this.decimalPoint == ',') {
                locale = Locale.GERMAN;
            }

            BigDecimalValidator validator = CurrencyValidator.getInstance();
            BigDecimal bdamount = validator.validate(amount, locale);

            return bdamount;
        } else {
            throw new ValidationException("Cannot parse " + amount);
        }
    }

}

From source file:carstore.CarStore.java

public CarStore() {
    if (log.isDebugEnabled()) {
        log.debug("Creating main CarStore bean");
        log.debug("Populating locale map");
    }//  w  w w . j ava  2 s . c  o m
    locales = new HashMap();
    locales.put("NAmerica", Locale.ENGLISH);
    locales.put("SAmerica", new Locale("es", "es"));
    locales.put("Germany", Locale.GERMAN);
    locales.put("France", Locale.FRENCH);
}

From source file:me.vertretungsplan.parser.TurboVertretungParser.java

private void parseTurboVertretungDay(SubstitutionSchedule v, Document doc) {
    SubstitutionScheduleDay day = new SubstitutionScheduleDay();

    String date = doc.select(".Titel").text().replaceFirst("Vertretungsplan( fr)? ", "");
    day.setDate(DateTimeFormat.forPattern("EEEE, d. MMMM yyyy").withLocale(Locale.GERMAN).parseLocalDate(date));

    String lastChange = doc.select(".Stand").text().replace("Stand: ", "");
    day.setLastChange(DateTimeFormat.forPattern("dd.MM.yyyy HH:mm:ss").withLocale(Locale.GERMAN)
            .parseLocalDateTime(lastChange));

    if (doc.text().contains("Kein Vertretungsplan")) {
        v.addDay(day);//from  w ww. jav  a  2s  . c  o  m
        return;
    }

    if (doc.select(".LehrerFrueher").size() > 0) {
        day.addMessage(doc.select(".LehrerFrueherLabel").text() + "\n" + doc.select(".LehrerFrueher").text());
    }
    if (doc.select(".LehrerVerplant").size() > 0) {
        day.addMessage(doc.select(".LehrerVerplantLabel").text() + "\n" + doc.select(".LehrerVerplant").text());
    }
    if (doc.select(".Abwesenheiten-Klassen").size() > 0) {
        day.addMessage(doc.select(".Abwesenheiten-KlassenLabel").text() + "\n"
                + doc.select(".Abwesenheiten-Klassen").text());
    }

    Element table = doc.select("table").first();
    for (Element row : table.select("tr:has(td)")) {
        Substitution substitution = new Substitution();
        substitution.setLesson(row.select(query("Stunde")).text());
        substitution.setPreviousTeacher(row.select(query("Lehrer")).text());
        substitution.setTeacher(row.select(query("Vertretung")).text());
        substitution.setClasses(new HashSet<>(Arrays.asList(row.select(query("Klasse")).text().split(" "))));
        substitution.setSubject(row.select(query("Fach")).text());
        substitution.setDesc(row.select(query("Anmerkung")).text());
        substitution.setRoom(row.select(query("Raum")).text());

        String type = recognizeType(row.select(query("Anmerkung")).text());
        if (type == null)
            type = "Vertretung";
        substitution.setType(type);
        substitution.setColor(colorProvider.getColor(type));

        day.addSubstitution(substitution);
    }

    v.addDay(day);
}

From source file:de.alpharogroup.message.system.service.MessagesBusinessServiceTest.java

public Users getUser(final String firstname, final String lastname, final String email, final String username) {

    final UserManagementModelFactory userManagementModelFactory = UserManagementModelFactory.getInstance();
    final UserModel userModel = userManagementModelFactory.newUserModel(lastname,
            CreateDateExtensions.newDate(1974, 8, 28), firstname, GenderType.MALE, "127.0.0.1", lastname,
            Locale.GERMAN, "01721745676", "032325444444", "032325444445", addressesService.get(30224)); // Ludwigsburg

    final UsernameSignUpModel usernameSignUpModel = userManagementModelFactory.newUsernameSignupModel(email,
            "xxx", "xxx", Boolean.TRUE, username);

    final Set<Roles> roles = createRolesSet();
    final SignUpUserResult result = userManagementService.signUpUser(usernameSignUpModel, roles, userModel);
    if (result.getUser() == null) {
        final ValidationErrors errors = result.getValidationErrors();
        if (errors.equals(ValidationErrors.EMAIL_EXISTS_ERROR)) {
            return userManagementService.findUserWithEmailOrUsername(email);
        }//from   ww  w.  ja v  a2  s  .c  o  m
        if (errors.equals(ValidationErrors.USERNAME_EXISTS_ERROR)) {
            return userManagementService.findUserWithEmailOrUsername(username);
        }
    }
    return result.getUser();
}