本文整理汇总了Java中java.util.Locale.GERMAN属性的典型用法代码示例。如果您正苦于以下问题:Java Locale.GERMAN属性的具体用法?Java Locale.GERMAN怎么用?Java Locale.GERMAN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.util.Locale
的用法示例。
在下文中一共展示了Locale.GERMAN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAsObject_GermanLocale
/**
* Test for getting value for German local.
*/
@Test
public void getAsObject_GermanLocale() throws ConverterException {
context = new FacesContextStub(Locale.GERMAN);
String str = "1,23";
UIComponent component = ConverterTestHelper.getComponent(false, null,
null, "discount");
BigDecimal expected = new BigDecimal("1.23");
BigDecimal actual = (BigDecimal) converter.getAsObject(context,
component, str);
assertEquals(expected, actual);
context = new FacesContextStub(Locale.ENGLISH);
}
示例2: _getDataForPatterns
private Object[][] _getDataForPatterns()
{
// pattern, inputvalue,locale,timezone
Object[][] data =
{
{"yyyy.MM.dd G 'at' HH:mm:ss z", "2001.07.04 AD at 12:08:56 PDT", Locale.US, null },
{"EEE, MMM d, ''yy","Wed, Jul 4, '01", Locale.ENGLISH, getTzone("GMT")},
{"h:mm a","12:08 PM", Locale.GERMAN, getTzone("GMT+1")},
{"hh 'o''clock' a, zzzz","12 o'clock PM, Pacific Standard Time", Locale.CANADA, getTzone("GMT-8")},
{"K:mm a, z","0:08 PM, PST", Locale.US, getTzone("PST")},
{"yyyyy.MMMMM.dd GGG hh:mm aaa","02001.July.04 AD 12:08 PM", Locale.US, null},
{"EEE, d MMM yyyy HH:mm:ss Z","Wed, 4 Jul 2001 12:08:56 GMT",Locale.US, getTzone("GMT")},
{"yyMMddHHmmss", "010704120856", Locale.ENGLISH, null, null},
};
return data;
}
示例3: testParse_GermanLocaleOwnOutput
@Test
public void testParse_GermanLocaleOwnOutput() throws Exception {
PriceConverter converter = new PriceConverter(Locale.GERMAN);
Assert.assertEquals(Locale.GERMAN, converter.getActiveLocale());
long price = 50L;
String valueToDisplay = converter.getValueToDisplay(new BigDecimal(
price), true);
BigDecimal valueToStore = converter.parse(valueToDisplay);
checkEquals("50.00", valueToStore);
}
示例4: redirectSystemOutput
/**
*
* @param toFile
*/
public void redirectSystemOutput(boolean toFile) {
try {
if (toFile) {
Log.i(DEBUG_TAG,"redirecting sysout to file");
//Redirecting console output and runtime exceptions to file (System.out.println)
File f = new File(Environment.getExternalStorageDirectory(), "qosdebug");
if (!f.exists()) {
f.mkdir();
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd", Locale.GERMAN);
//PrintStream fileStream = new PrintStream(new File(f, sdf.format(new Date()) + ".txt"));
PrintStream fileStream = new DebugPrintStream(new File(f, sdf.format(new Date()) + ".txt"));
//System.setOut(fileStream);
System.setErr(fileStream);
}
else {
//Redirecting console output and runtime exceptions to default output stream
//System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
//System.setErr(new PrintStream(new FileOutputStream(FileDescriptor.err)));
//Log.i(DEBUG_TAG,"redirecting sysout to default");
}
}
catch (Exception e) {
e.printStackTrace();
}
}
示例5: testValidate_DurationFloatInputGerman
@Test(expected = ValidatorException.class)
public void testValidate_DurationFloatInputGerman() throws Exception {
context = new FacesContextStub(Locale.GERMAN);
UIComponentStub stub = getComponent(DATATYPE_DURATION, false, null,
null);
validator.validate(context, stub, "1,1");
}
示例6: main
public static void main(String args[]) {
Bug8154797.generateExpectedValues();
Locale[] locArr = {new Locale("hi", "IN"), Locale.UK, new Locale("fi", "FI"),
Locale.ROOT, Locale.GERMAN, Locale.JAPANESE,
Locale.ENGLISH, Locale.FRANCE};
for (Locale loc : locArr) {
Bug8154797.compareResources(loc);
}
}
示例7: doInBackground
@Override
@SuppressLint("DefaultLocale")
protected Bitmap doInBackground(Void... params) {
if (!EssensbonUtils.isLoggedIn())
return null;
if (hasActiveInternetConnection()) {
if (onAppStart) {
if (EssensbonUtils.isAutoSyncEnabled())
saveNewestEntries();
} else
saveNewestEntries();
}
Order act = getRecentEntry();
if (act == null)
return null;
menu = act.getMenu();
description = act.getDescr();
short id = act.getId();
DateFormat dateFormat = new SimpleDateFormat("ddMMyyy", Locale.GERMAN);
Date date = new Date();
String dateS = dateFormat.format(date);
dateS = dateS.substring(0, 4) + dateS.substring(5);
int cur = Integer.parseInt(dateS)+id;
int mod = cur%97;
int fin = 98-mod;
String formattedChecksum = String.format("%02d", fin);
String code = id+"-"+"M"+menu+"-"+dateS+"-"+formattedChecksum;
return createNewQR(code);
}
示例8: data_localeList
@DataProvider(name = "localeList")
Locale[] data_localeList() {
return new Locale[] {
Locale.US,
Locale.GERMAN,
Locale.JAPAN,
Locale.ROOT,
};
}
示例9: testParse_GermanLocaleWithSeparators
@Test
public void testParse_GermanLocaleWithSeparators() throws Exception {
PriceConverter converter = new PriceConverter(Locale.GERMAN);
Assert.assertEquals(Locale.GERMAN, converter.getActiveLocale());
BigDecimal valueToStore = converter.parse("...,3");
checkEquals("0.3", valueToStore);
String valueToDisplay = converter.getValueToDisplay(valueToStore, true);
Assert.assertEquals("0,30", valueToDisplay);
}
示例10: testParse_GermanLocaleWithSeparator
@Test
public void testParse_GermanLocaleWithSeparator() throws Exception {
PriceConverter converter = new PriceConverter(Locale.GERMAN);
Assert.assertEquals(Locale.GERMAN, converter.getActiveLocale());
BigDecimal valueToStore = converter.parse("50.000,14");
checkEquals("50000.14", valueToStore);
}
示例11: testParse_MaximumIntegerDigitsDE_WithGroupingSeparators
@Test
public void testParse_MaximumIntegerDigitsDE_WithGroupingSeparators()
throws Exception {
PriceConverter converter = new PriceConverter(Locale.GERMAN);
Assert.assertEquals(Locale.GERMAN, converter.getActiveLocale());
BigDecimal d = converter
.parse("111111111111111111111.1.1111111111111111111111.111.111,001");
assertEquals(new BigDecimal(
"11111111111111111111111111111111111111111111111111.001"), d);
}
示例12: getLocale
private Locale getLocale(String localeName) {
String language, country;
int index;
index = localeName.indexOf('_');
if (index == -1) {
//
// Special case the builtin JDK languages
//
if (localeName.equals("de"))
return Locale.GERMAN;
if (localeName.equals("en"))
return Locale.ENGLISH;
if (localeName.equals("fr"))
return Locale.FRENCH;
if (localeName.equals("it"))
return Locale.ITALIAN;
if (localeName.equals("ja"))
return Locale.JAPANESE;
if (localeName.equals("ko"))
return Locale.KOREAN;
if (localeName.equals("zh"))
return Locale.CHINESE;
language = localeName;
country = "";
} else {
if (localeName.equals("zh_CN"))
return Locale.SIMPLIFIED_CHINESE;
if (localeName.equals("zh_TW"))
return Locale.TRADITIONAL_CHINESE;
//
// JDK also has constants for countries: en_GB, en_US, en_CA,
// fr_FR, fr_CA, de_DE, ja_JP, ko_KR. We don't use those.
//
language = localeName.substring(0, index);
country = localeName.substring(index + 1);
}
return new Locale(language, country);
}
示例13: DbMessages_de
public DbMessages_de() throws IOException {
super(Locale.GERMAN);
}
示例14: DefaultMessages_de
public DefaultMessages_de() throws IOException {
super(Locale.GERMAN);
}
示例15: asTime_withLocaleGERMAN_returns_19_28
@Test
public void asTime_withLocaleGERMAN_returns_19_28() throws Exception {
dateTimeFormatter = new DateTimeFormatter(Locale.GERMAN);
assertEquals("19:28", dateTimeFormatter.asTime(of(19, 28, 15)));
}