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


Java Strings.toString方法代碼示例

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


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

示例1: serialize

import org.oscm.string.Strings; //導入方法依賴的package包/類
private String serialize(Object jaxbTree) throws JAXBException,
        PropertyException {
    JAXBContext jc = JAXBContext.newInstance(jaxbTree.getClass());
    System.out.println(jc.getClass().getCanonicalName());
    Marshaller marshaller = jc.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    marshaller.marshal(jaxbTree, bos);
    String xmlAsString = Strings.toString(bos.toByteArray());
    return xmlAsString;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:13,代碼來源:MpOwnerShareResultAssemblerTest.java

示例2: BulkUserImportReader

import org.oscm.string.Strings; //導入方法依賴的package包/類
public BulkUserImportReader(byte[] cvsData) {
    try {
        Reader reader = new StringReader(Strings.toString(cvsData));
        csvParser = BULK_USER_IMPORT_CSV_FORMAT.parse(reader);
    } catch (IOException e) {
        throw new RuntimeException(e); // cannot happen
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:9,代碼來源:BulkUserImportReader.java

示例3: openUiMessages

import org.oscm.string.Strings; //導入方法依賴的package包/類
/**
 * Load properties for UI
 */
@Test
public void openUiMessages() throws Exception {
    InputStream stream = DefaultMessages.openUiMessages(Locale.ENGLISH);
    String result = Strings.toString(Streams.readFrom(stream));
    assertFalse(result.isEmpty());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:10,代碼來源:DefaultMessagesTest.java

示例4: openUiMessages_fallback

import org.oscm.string.Strings; //導入方法依賴的package包/類
/**
 * Load default locale if no translation exists for the requested locale
 */
@Test
public void openUiMessages_fallback() throws Exception {
    InputStream stream = DefaultMessages.openUiMessages(Locale.CHINA);
    String result = Strings.toString(Streams.readFrom(stream));
    assertFalse(result.isEmpty());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:10,代碼來源:DefaultMessagesTest.java

示例5: openResource

import org.oscm.string.Strings; //導入方法依賴的package包/類
@Test
public void openResource() throws Exception {
    InputStream stream = DefaultMessages
            .openResource("ExceptionMessages_en.properties");
    String result = Strings.toString(Streams.readFrom(stream));
    assertFalse(result.isEmpty());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:8,代碼來源:DefaultMessagesTest.java

示例6: openExceptionMessages

import org.oscm.string.Strings; //導入方法依賴的package包/類
/**
 * Load properties for exceptions
 */
@Test
public void openExceptionMessages() throws Exception {
    InputStream stream = DefaultMessages
            .openExceptionMessages(Locale.ENGLISH);
    String result = Strings.toString(Streams.readFrom(stream));
    assertFalse(result.isEmpty());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:11,代碼來源:DefaultMessagesTest.java

示例7: openExceptionMessages_fallback

import org.oscm.string.Strings; //導入方法依賴的package包/類
/**
 * Load default locale if no translation exists for the requested locale
 */
@Test
public void openExceptionMessages_fallback() throws Exception {
    InputStream stream = DefaultMessages
            .openExceptionMessages(Locale.CHINA);
    String result = Strings.toString(Streams.readFrom(stream));
    assertFalse(result.isEmpty());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:11,代碼來源:DefaultMessagesTest.java


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