Search in sources :

Example 41 with Serializable

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;
}
Also used : Serializable(java.io.Serializable) ByteArrayInputStream(java.io.ByteArrayInputStream) ObjectInputStream(java.io.ObjectInputStream)

Example 42 with Serializable

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);
}
Also used : Serializable(java.io.Serializable) ListView(org.apache.wicket.markup.html.list.ListView) Label(org.apache.wicket.markup.html.basic.Label) Model(org.apache.wicket.model.Model) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ListItem(org.apache.wicket.markup.html.list.ListItem) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 43 with Serializable

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);
}
Also used : Serializable(java.io.Serializable) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) ImgResources(com.evolveum.midpoint.web.resource.img.ImgResources) ListView(org.apache.wicket.markup.html.list.ListView) FocusSubwrapperDto(com.evolveum.midpoint.web.page.admin.users.dto.FocusSubwrapperDto) PackageResourceReference(org.apache.wicket.request.resource.PackageResourceReference) InlineMenu(com.evolveum.midpoint.web.component.menu.cog.InlineMenu) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) PropertyModel(org.apache.wicket.model.PropertyModel) AjaxCheckBox(org.apache.wicket.ajax.markup.html.form.AjaxCheckBox) AttributeModifier(org.apache.wicket.AttributeModifier) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) Panel(org.apache.wicket.markup.html.panel.Panel) ObjectBrowserPanel(com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel) IModel(org.apache.wicket.model.IModel) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) Model(org.apache.wicket.model.Model) PropertyModel(org.apache.wicket.model.PropertyModel) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) ListItem(org.apache.wicket.markup.html.list.ListItem)

Example 44 with Serializable

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());
}
Also used : Serializable(java.io.Serializable) HashMap(java.util.HashMap) ProcessInstance(org.bonitasoft.engine.bpm.process.ProcessInstance)

Example 45 with Serializable

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();
}
Also used : Serializable(java.io.Serializable) ObjectInputStream(java.io.ObjectInputStream)

Aggregations

Serializable (java.io.Serializable)3100 Test (org.junit.Test)906 HashMap (java.util.HashMap)789 ArrayList (java.util.ArrayList)420 Map (java.util.Map)370 List (java.util.List)208 QName (org.alfresco.service.namespace.QName)197 IOException (java.io.IOException)174 Metacard (ddf.catalog.data.Metacard)145 NodeRef (org.alfresco.service.cmr.repository.NodeRef)135 LinkedHashMap (java.util.LinkedHashMap)128 HashSet (java.util.HashSet)122 Date (java.util.Date)114 ByteArrayInputStream (java.io.ByteArrayInputStream)82 ParserContext (org.mvel2.ParserContext)82 Set (java.util.Set)80 File (java.io.File)75 ObjectInputStream (java.io.ObjectInputStream)65 Session (org.hibernate.Session)65 URI (java.net.URI)64