当前位置: 首页>>代码示例>>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;未经允许,请勿转载。