本文整理匯總了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());
}