Package org.jitterbit.util.persist

Examples of org.jitterbit.util.persist.Persistor


        String type = p.getString("opType");
        // opType will be null when reading a project that was created in a 2.0 version
        // earlier than 2.0.0.27.
        opType = (type != null ? OperationType.valueOf(p.getString("opType")) : op.getOperationType());
        entries = Lists.newArrayList();
        Persistor activities = p.getFirstChild("Activities");
        for (Persistor a : activities.getAllChildren()) {
            entries.add(new Entry(a));
        }
    }
View Full Code Here


     * Writes this memento to the given <code>Persistor</code>.
     *
     */
    public void writeTo(Persistor p) {
        p.putString("opType", opType.name());
        Persistor root = p.createChild("Activities");
        for (Entry e : entries) {
            e.writeTo(root);
        }
    }
View Full Code Here

                throw new IllegalStateException("Unexpected activity type: " + type);
            }
        }

        public void writeTo(Persistor p) {
            Persistor e = p.createChild(type.name());
            e.putString("role", role);
            e.putString("activityId", activityId.toString());
            if (contentId != null) {
                e.putString("contentId", contentId.toString());
            }
        }
View Full Code Here

            }
        }
    }

    private static void save(RootFolder rf, Persistor media) {
        Persistor p = media.createChild(ENTITY_TYPE);
        p.putString(NAME, rf.getItemType().name());
        for (IntegrationEntity child : rf.getAllChildren()) {
            save(child, p);
        }
    }
View Full Code Here

        }
    }

    private static void save(IntegrationEntity e, Persistor parent) {
        if (e instanceof Folder) {
            Persistor folder = parent.createChild(FOLDER);
            folder.putString(ENTITY_ID, e.getID().toString());
            folder.putString(NAME, e.getName());
            for (IntegrationEntity child : e.getAllChildren()) {
                save(child, folder);
            }
        } else if (!e.isTransient()) {
            Persistor entity = parent.createChild(ENTITY);
            entity.putString(ENTITY_ID, e.getID().toString());
            entity.putString(NAME, e.getName());
        }
    }
View Full Code Here

    }

    @Override
    public synchronized Persistor getClassSettings(EntityType type) {
        XmlPersistor root = getRoot(type);
        Persistor p = root.getFirstChild(CLASS_SETTINGS);
        if (p == null) {
            p = root.createChild(CLASS_SETTINGS);
        }
        return p;
    }
View Full Code Here

    @Override
    public synchronized Persistor getEntitySettings(IntegrationEntity entity) {
        XmlPersistor root = getRoot(entity.getEntityType());
        String name = getNameOfEntityPersistor(entity);
        Persistor p = root.getFirstChild(name);
        if (p == null) {
            p = root.createChild(name);
        }
        return p;
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.util.persist.Persistor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.