本文整理汇总了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;
}
示例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
}
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}