当前位置: 首页>>代码示例>>Java>>正文


Java SerializationUtils.deserializeFromBase64方法代码示例

本文整理汇总了Java中org.kuali.rice.core.api.util.io.SerializationUtils.deserializeFromBase64方法的典型用法代码示例。如果您正苦于以下问题:Java SerializationUtils.deserializeFromBase64方法的具体用法?Java SerializationUtils.deserializeFromBase64怎么用?Java SerializationUtils.deserializeFromBase64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.core.api.util.io.SerializationUtils的用法示例。


在下文中一共展示了SerializationUtils.deserializeFromBase64方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unwrapPayload

import org.kuali.rice.core.api.util.io.SerializationUtils; //导入方法依赖的package包/类
/**
        * Extracts the payload from a PersistedMessageBO, attempts to convert it to the expected AsynchronousCall type, and
        * returns it.
        *
        * Throws an IllegalArgumentException if the decoded payload isnt of the expected type.
        *
        * @param message
        *                The populated PersistedMessageBO object to extract the payload from.
        * @return Returns the payload if one is present and it can be deserialized, otherwise returns null.
        */
   protected AsynchronousCall unwrapPayload(PersistedMessageBO message) {
if (message == null || message.getPayload() == null) {
    return null;
}
String encodedPayload = message.getPayload().getPayload();
if (StringUtils.isBlank(encodedPayload)) {
    return null;
}
Object decodedPayload = null;
if (encodedPayload != null) {
    decodedPayload = SerializationUtils.deserializeFromBase64(encodedPayload);
}
// fail fast if its not the expected type of AsynchronousCall
if ((decodedPayload != null) && !(decodedPayload instanceof AsynchronousCall)) {
    throw new IllegalArgumentException("PersistedMessageBO payload was not of the expected class. " + "Expected was ["
	    + AsynchronousCall.class.getName() + "], actual was: [" + decodedPayload.getClass().getName() + "]");
}
return (AsynchronousCall) decodedPayload;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:30,代码来源:MessageQueueAction.java

示例2: getMethodCall

import org.kuali.rice.core.api.util.io.SerializationUtils; //导入方法依赖的package包/类
public AsynchronousCall getMethodCall() {
if (this.methodCall != null) {
    return this.methodCall;
} 
this.methodCall = (AsynchronousCall) SerializationUtils.deserializeFromBase64(getPayload());
return this.methodCall;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:PersistedMessagePayload.java

示例3: testQNameSerializaion

import org.kuali.rice.core.api.util.io.SerializationUtils; //导入方法依赖的package包/类
@Test public void testQNameSerializaion() throws Exception {
	
	QName qname = new QName("hi", "HI");
	String qnameSerialized = SerializationUtils.serializeToBase64(qname);
	SerializationUtils.deserializeFromBase64(qnameSerialized);
	assertTrue(true);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:QNameSerializationTest.java


注:本文中的org.kuali.rice.core.api.util.io.SerializationUtils.deserializeFromBase64方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。