use of java.io.Serializable in project mybatis-3 by mybatis.
the class SerializableProxyTest method deserialize.
protected Serializable deserialize(byte[] value) throws Exception {
ByteArrayInputStream bis = new ByteArrayInputStream(value);
ObjectInputStream ois = new ObjectInputStream(bis);
Serializable result = (Serializable) ois.readObject();
ois.close();
return result;
}
use of java.io.Serializable in project midpoint by Evolveum.
the class DropdownButtonPanel method initLayout.
private void initLayout(DropdownButtonDto model) {
Label info = new Label(ID_INFO, model.getInfo());
add(info);
Label label = new Label(ID_LABEL, model.getLabel());
add(label);
WebMarkupContainer icon = new WebMarkupContainer(ID_ICON);
icon.add(AttributeModifier.append("class", model.getIcon()));
add(icon);
ListView<InlineMenuItem> li = new ListView<InlineMenuItem>(ID_MENU_ITEM, new Model((Serializable) model.getMenuItems())) {
@Override
protected void populateItem(ListItem<InlineMenuItem> item) {
initMenuItem(item);
}
};
add(li);
}
use of java.io.Serializable in project midpoint by Evolveum.
the class FocusProjectionsTabPanel method initLayout.
private void initLayout(final PageBase page) {
final WebMarkupContainer shadows = new WebMarkupContainer(ID_SHADOWS);
shadows.setOutputMarkupId(true);
add(shadows);
InlineMenu accountMenu = new InlineMenu(ID_SHADOW_MENU, new Model((Serializable) createShadowMenu()));
accountMenu.setVisible(!getObjectWrapper().isReadonly());
shadows.add(accountMenu);
final ListView<FocusSubwrapperDto<ShadowType>> projectionList = new ListView<FocusSubwrapperDto<ShadowType>>(ID_SHADOW_LIST, projectionModel) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<FocusSubwrapperDto<ShadowType>> item) {
PackageResourceReference packageRef;
final FocusSubwrapperDto<ShadowType> dto = item.getModelObject();
final PropertyModel<ObjectWrapper<F>> objectWrapperModel = new PropertyModel<ObjectWrapper<F>>(item.getModel(), "object");
final Panel shadowPanel;
if (dto.isLoadedOK()) {
packageRef = new PackageResourceReference(ImgResources.class, ImgResources.HDD_PRISM);
shadowPanel = new PrismObjectPanel<F>(ID_SHADOW, new PropertyModel<ObjectWrapper<F>>(item.getModel(), "object"), packageRef, getMainForm(), getPageBase());
} else {
shadowPanel = new SimpleErrorPanel<ShadowType>(ID_SHADOW, item.getModel()) {
private static final long serialVersionUID = 1L;
@Override
public void onShowMorePerformed(AjaxRequestTarget target) {
OperationResult fetchResult = dto.getResult();
if (fetchResult != null) {
showResult(fetchResult);
target.add(page.getFeedbackPanel());
}
}
};
}
shadowPanel.setOutputMarkupId(true);
shadowPanel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
FocusSubwrapperDto<ShadowType> shadowWrapperDto = item.getModelObject();
ObjectWrapper<ShadowType> shadowWrapper = shadowWrapperDto.getObject();
return !shadowWrapper.isMinimalized();
}
});
item.add(shadowPanel);
CheckTableHeader<F> shadowHeader = new CheckTableHeader<F>(ID_SHADOW_HEADER, objectWrapperModel) {
private static final long serialVersionUID = 1L;
@Override
protected void onClickPerformed(AjaxRequestTarget target) {
super.onClickPerformed(target);
onExpandCollapse(target, item.getModel());
target.add(shadows);
}
};
if (item.getModel().getObject().getStatus().equals(UserDtoStatus.DELETE)) {
shadowHeader.add(new AttributeModifier("class", "box-header with-border delete"));
}
item.add(shadowHeader);
}
};
AjaxCheckBox accountCheckAll = new AjaxCheckBox(ID_SHADOW_CHECK_ALL, new Model()) {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
for (FocusSubwrapperDto<ShadowType> dto : projectionList.getModelObject()) {
if (dto.isLoadedOK()) {
ObjectWrapper<ShadowType> accModel = dto.getObject();
accModel.setSelected(getModelObject());
}
}
target.add(shadows);
}
};
shadows.add(accountCheckAll);
shadows.add(projectionList);
}
use of java.io.Serializable in project tdi-studio-se by Talend.
the class Client method startProcess.
public String startProcess(String processDefinitionId, Map<String, Object> processVariables) throws BonitaException {
Map<String, Serializable> listVariablesSerializable = new HashMap<String, Serializable>();
for (String variableName : processVariables.keySet()) {
if (processVariables.get(variableName) == null || (!(processVariables.get(variableName) instanceof Serializable))) {
continue;
}
Object value = processVariables.get(variableName);
Serializable valueSerializable = (Serializable) value;
variableName = variableName.toLowerCase();
listVariablesSerializable.put(variableName, valueSerializable);
}
ProcessInstance processInstance = processAPI.startProcess(Long.parseLong(processDefinitionId), listVariablesSerializable);
return String.valueOf(processInstance.getId());
}
use of java.io.Serializable in project voltdb by VoltDB.
the class InOutUtil method deserialize.
/**
* Deserializes the specified byte array to an
* <CODE>Object</CODE> instance.
*
* @return the Object resulting from deserializing the specified array of bytes
* @param ba the byte array to deserialize to an Object
*/
public static Serializable deserialize(byte[] ba) throws IOException, ClassNotFoundException {
HsqlByteArrayInputStream bi = new HsqlByteArrayInputStream(ba);
ObjectInputStream is = new ObjectInputStream(bi);
return (Serializable) is.readObject();
}
Aggregations