Package com.google.devtools.depan.eclipse.persist

Examples of com.google.devtools.depan.eclipse.persist.ObjectXmlPersist


  protected final ObjectXmlPersist xmlPersist;

  public RelSetXmlPersist() {
    this.xmlPersist =
        new ObjectXmlPersist(XStreamFactory.getSharedGraphXStream());
  }
View Full Code Here


    if (input instanceof IFileEditorInput) {
      try {
        uri = ((IFileEditorInput) input).getFile().getLocationURI();
        // TODO(leeca):  Is this configured with the correct XStream flavor?
        ObjectXmlPersist persist =
            new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());

        migrationTask = loadMigrationTask(persist);
        this.setPartName(migrationTask.getName());
      } catch (IOException errIo) {
        throw new PartInitException("Unable to load migration task from " + uri, errIo);
View Full Code Here

  @Override
  public void doSave(IProgressMonitor monitor) {
    try {
      // TODO(leeca):  Is this configured with the correct XStream flavor?
      ObjectXmlPersist persist =
          new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());
      persist.save(uri, migrationTask);
      setDirtyState(false);
    } catch (IOException errIo) {
      monitor.setCanceled(true);
      throw new RuntimeException(
          "Unable to save migration task to " + uri, errIo);
View Full Code Here

  /**
   * Load a view document from a file.
   */
  private static ViewDocument loadViewDocument(IFile viewFile)
      throws IOException {
    ObjectXmlPersist persist =
        new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());
    return (ViewDocument) persist.load(viewFile.getRawLocationURI());
  }
View Full Code Here

   */
  private static void saveViewDocument(IFile viewFile, ViewDocument viewInfo)
      throws IOException {
    XStream xstream = XStreamFactory.newStaxXStream();
    XStreamFactory.configureRefXStream(xstream);
    ObjectXmlPersist persist = new ObjectXmlPersist(xstream);
    persist.save(viewFile.getRawLocationURI(), viewInfo);
  }
View Full Code Here

    IContainer container = (IContainer) resource;
    final IFile file = container.getFile(new Path(filename));

    // save the builtins relationships as an "example" in the file.
    // TODO(leeca):  Is this configured with the correct XStream flavor?
    ObjectXmlPersist persist =
        new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());
    persist.save(file.getLocationURI(), Collections.EMPTY_LIST);

    monitor.worked(1);
  }
View Full Code Here

   * @param setName the set name
   */
  private void addToSet(IFile file, String setName)
      throws IOException, CoreException {
    // TODO(leeca):  Is this configured with the correct XStream flavor?
    ObjectXmlPersist persist =
        new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());
    Collection<RelationshipSet> updateSet = loadRelationshipSet(persist, file);
    RelationshipSet set = DefaultRelationshipSet.SET;
    updateSet.add(set);
    persist.save(file.getLocationURI(), updateSet);
    file.refreshLocal(IResource.DEPTH_ZERO, null);
  }
View Full Code Here

    Collection<RelationshipSet> collection = new ArrayList<RelationshipSet>();
    collection.add(set);

    // save data in the file
    // TODO(leeca):  Is this configured with the correct XStream flavor?
    ObjectXmlPersist persist =
        new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());
    persist.save(file.getLocationURI(), collection);
    file.refreshLocal(IResource.DEPTH_ZERO, null);
  }
View Full Code Here

  @Override
  public void doSave(IProgressMonitor monitor) {
    try {
      // TODO(leeca):  Is this configured with the correct XStream flavor?
      ObjectXmlPersist persist =
          new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());
      persist.save(file.getRawLocationURI(), sets);

      setDirtyState(false);

      // touch the file, to notify listeners about the changes
      file.touch(monitor);
View Full Code Here

        IFileEditorInput fileInput = (IFileEditorInput) input;
        file = fileInput.getFile();

        // load the file and retrieve its content in sets.
        // TODO(leeca):  Is this configured with the correct XStream flavor?
        ObjectXmlPersist persist =
            new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());

        sets = loadNamedRelationship(persist, file.getRawLocationURI());

        setDirtyState(false);
      } catch (IOException errIo) {
View Full Code Here

TOP

Related Classes of com.google.devtools.depan.eclipse.persist.ObjectXmlPersist

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.