當前位置: 首頁>>代碼示例>>Java>>正文


Java Locale.CANADA_FRENCH屬性代碼示例

本文整理匯總了Java中java.util.Locale.CANADA_FRENCH屬性的典型用法代碼示例。如果您正苦於以下問題:Java Locale.CANADA_FRENCH屬性的具體用法?Java Locale.CANADA_FRENCH怎麽用?Java Locale.CANADA_FRENCH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.util.Locale的用法示例。


在下文中一共展示了Locale.CANADA_FRENCH屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testSerializeBinaryProperty

@Test
public void testSerializeBinaryProperty() throws IOException
{
    BinaryProperty prop = new BinaryProperty(Format.JSON.mimetype(),"UTF-8");      
    String out = writeResponse(prop);
    assertTrue("Only show the mimeType",  out.equals("{\"mimeType\":\"application/json\"}"));
    prop = new BinaryProperty(Format.XML.mimetype(),"UTF-8", 45, null);      
    out = writeResponse(prop);
    assertTrue("Type is xml.",  StringUtils.contains(out, "\"mimeType\":\"text/xml\""));
    assertTrue("Size must be serialized.",  StringUtils.contains(out, "\"sizeInBytes\":45"));
    
    prop = new BinaryProperty(Format.XML.mimetype(),"UTF-8", 99, Locale.CANADA_FRENCH);      
    out = writeResponse(prop);
    assertFalse("Locale should not be serialized",  StringUtils.contains(out, "\"locale\""));
    
    //Check binary properties serialize ok as part of a bean.
    Flock flock = new Flock("myflock", 50, null, prop);
    out = writeResponse(flock);
    assertFalse("Locale should not be serialized",  StringUtils.contains(out, "\"locale\""));
    assertTrue("Type is xml.",  StringUtils.contains(out, "\"mimeType\":\"text/xml\""));
    assertTrue("Size must be serialized.",  StringUtils.contains(out, "\"sizeInBytes\":99"));
}
 
開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:22,代碼來源:SerializeTests.java

示例2: isSharedFlyweight

private static boolean isSharedFlyweight(Object obj) {
    if (obj == null) {
        return true;
    }
    if (obj == Boolean.TRUE || obj == Boolean.FALSE) {
        return true;
    }
    if (/* obj == Locale.ROOT || *//* Java 6 */
    obj == Locale.ENGLISH || obj == Locale.FRENCH || obj == Locale.GERMAN || obj == Locale.ITALIAN
            || obj == Locale.JAPANESE || obj == Locale.KOREAN || obj == Locale.CHINESE
            || obj == Locale.SIMPLIFIED_CHINESE || obj == Locale.TRADITIONAL_CHINESE || obj == Locale.FRANCE
            || obj == Locale.GERMANY || obj == Locale.ITALY || obj == Locale.JAPAN || obj == Locale.KOREA
            || obj == Locale.CHINA || obj == Locale.PRC || obj == Locale.TAIWAN || obj == Locale.UK
            || obj == Locale.US || obj == Locale.CANADA || obj == Locale.CANADA_FRENCH) {
        return true;
    }
    if (obj == Collections.EMPTY_SET || obj == Collections.EMPTY_LIST || obj == Collections.EMPTY_MAP) {
        return true;
    }
    if (obj == BigInteger.ZERO || obj == BigInteger.ONE) {
        return true;
    }
    if (obj == System.in || obj == System.out || obj == System.err) {
        return true;
    }
    if (obj == String.CASE_INSENSITIVE_ORDER) {
        return true;
    }
    if (obj == JarFile.MANIFEST_NAME) {
        return true;
    }
    return false;
}
 
開發者ID:luoyaogui,項目名稱:otter-G,代碼行數:33,代碼來源:ObjectProfiler.java

示例3: setUp

@Override
protected void setUp()
{
    mlText = new MLText(Locale.CANADA_FRENCH, Locale.CANADA_FRENCH.toString());
    mlText.addValue(Locale.US, Locale.US.toString());
    mlText.addValue(Locale.UK, Locale.UK.toString());
    mlText.addValue(Locale.FRENCH, Locale.FRENCH.toString());
    mlText.addValue(Locale.CHINESE, Locale.CHINESE.toString());
}
 
開發者ID:Alfresco,項目名稱:alfresco-data-model,代碼行數:9,代碼來源:MLTextTest.java

示例4: createTestling

@Override
protected C createTestling(final BaseContext.Env environment, final boolean enableServiceBrokerFake) {
    return (C) new MockingScriptContext(Locale.CANADA_FRENCH, enableServiceBrokerFake, environment);
}
 
開發者ID:e-Spirit,項目名稱:FSTestTools,代碼行數:4,代碼來源:MockingScriptContextTest.java

示例5: createTestling

@Override
protected C createTestling(final BaseContext.Env environment, final boolean enableServiceBrokerFake) {
    return (C) new MockingReportContext(Locale.CANADA_FRENCH, enableServiceBrokerFake, environment);
}
 
開發者ID:e-Spirit,項目名稱:FSTestTools,代碼行數:4,代碼來源:MockingReportContextTest.java


注:本文中的java.util.Locale.CANADA_FRENCH屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。