public ModuleWrapper(final BufferedReader r) {
      myModule = null;
      myName = RW.readStringAttribute(r, "Module:");

      RW.readTag(r, "SourceProperties:");
      mySource = new Properties(r);

      RW.readTag(r, "TestProperties:");
      myTest = new Properties(r);

      RW.readTag(r, "Excludes:");
      myExcludes = (Set<String>) RW.readMany(r, RW.myStringReader, new HashSet<String>());

      RW.readTag(r, "Libraries:");
      myLibraries =
          (Set<LibraryWrapper>)
              RW.readMany(r, myLibraryWrapperReader, new HashSet<LibraryWrapper>());

      RW.readTag(r, "Dependencies:");
      myDependsOn =
          (List<ClasspathItemWrapper>)
              RW.readMany(
                  r, myWeakClasspathItemWrapperReader, new ArrayList<ClasspathItemWrapper>());
      myTestDependsOn =
          (List<ClasspathItemWrapper>)
              RW.readMany(
                  r, myWeakClasspathItemWrapperReader, new ArrayList<ClasspathItemWrapper>());
    }
    public void write(final BufferedWriter w) {
      RW.writeln(w, "Module:" + myName);

      RW.writeln(w, "SourceProperties:");
      mySource.write(w);

      RW.writeln(w, "TestProperties:");
      myTest.write(w);

      RW.writeln(w, "Excludes:");
      RW.writeln(w, myExcludes, RW.fromString);

      RW.writeln(w, "Libraries:");
      RW.writeln(w, myLibraries);

      RW.writeln(w, "Dependencies:");

      final List<ClasspathItemWrapper> weakened = new ArrayList<ClasspathItemWrapper>();

      for (ClasspathItemWrapper cpiw : dependsOn(false)) {
        weakened.add(weaken(cpiw));
      }

      RW.writeln(w, weakened);

      weakened.clear();

      for (ClasspathItemWrapper cpiw : dependsOn(true)) {
        weakened.add(weaken(cpiw));
      }

      RW.writeln(w, weakened);
    }
 public ClasspathItemWrapper read(final BufferedReader r) {
   final String s = RW.lookString(r);
   if (s.startsWith("Library:")) {
     return new WeakClasspathItemWrapper(RW.readStringAttribute(r, "Library:"), "Library");
   }
   if (s.startsWith("Module:")) {
     return new WeakClasspathItemWrapper(RW.readStringAttribute(r, "Module:"), "Module");
   } else {
     return new GenericClasspathItemWrapper(r);
   }
 }
      public void write(final BufferedWriter w) {
        RW.writeln(w, "Roots:");
        RW.writeln(w, myRoots, RW.fromString);

        RW.writeln(w, "Sources:");
        RW.writeln(w, mySources.keySet());

        RW.writeln(w, "Output:");
        RW.writeln(w, myOutput == null ? "" : myOutput);

        RW.writeln(w, "OutputStatus:" + myOutputStatus);
      }
  public void write(final BufferedWriter w) {
    RW.writeln(w, "Root:" + myRoot);

    RW.writeln(w, "Libraries:");
    RW.writeln(w, getLibraries());

    RW.writeln(w, "Modules:");
    RW.writeln(w, getModules());

    RW.writeln(w, affectedFiles, RW.fromString);
  }
      public Properties(final BufferedReader r) {
        RW.readTag(r, "Roots:");

        myRoots = (Set<String>) RW.readMany(r, RW.myStringReader, new HashSet<String>());

        RW.readTag(r, "Sources:");

        mySources = new HashMap<FileWrapper, FileWrapper>();

        for (FileWrapper fw :
            (Set<FileWrapper>) RW.readMany(r, myFileWrapperReader, new HashSet<FileWrapper>())) {
          mySources.put(fw, fw);
        }

        RW.readTag(r, "Output:");
        final String s = RW.readString(r);
        myOutput = s.equals("") ? null : s;

        myOutputStatus = RW.readStringAttribute(r, "OutputStatus:");
      }
  private ProjectWrapper(final BufferedReader r, final Set<String> affected) {
    affectedFiles = affected;
    myProject = null;
    myProjectBuilder = null;
    myHistory = null;

    myRoot = RW.readStringAttribute(r, "Root:");
    myProjectSnapshot =
        myHomeDir
            + File.separator
            + myJPSDir
            + File.separator
            + myRoot.replace(File.separatorChar, myFileSeparatorReplacement);

    RW.readTag(r, "Libraries:");
    final Set<LibraryWrapper> libs =
        (Set<LibraryWrapper>) RW.readMany(r, myLibraryWrapperReader, new HashSet<LibraryWrapper>());

    for (LibraryWrapper l : libs) {
      myLibraries.put(l.getName(), l);
    }

    RW.readTag(r, "Modules:");
    final Set<ModuleWrapper> mods =
        (Set<ModuleWrapper>) RW.readMany(r, myModuleWrapperReader, new HashSet<ModuleWrapper>());

    for (ModuleWrapper m : mods) {
      myModules.put(m.getName(), m);
    }

    RW.readMany(r, RW.myStringReader, affectedFiles);

    try {
      dependencyMapping = new Mappings(getMapDir());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    backendCallback = dependencyMapping.getCallback();
  }
    public void write(final BufferedWriter w) {
      final String name = getName();

      RW.writeln(w, name);
      RW.writeln(w, Long.toString(getStamp()));
    }
 FileWrapper(final BufferedReader r) {
   myName = RW.readString(r);
   myModificationTime = RW.readLong(r);
 }
 public void write(final BufferedWriter w) {
   RW.writeln(w, myType);
   RW.writeln(w, "Classpath:");
   RW.writeln(w, myClassPath, RW.fromString);
 }
    public GenericClasspathItemWrapper(final BufferedReader r) {
      myType = RW.readString(r);

      RW.readTag(r, "Classpath:");
      myClassPath = (List<String>) RW.readMany(r, RW.myStringReader, new ArrayList<String>());
    }
 public void write(final BufferedWriter w) {
   RW.writeln(w, myType + ":" + getName());
 }
    public LibraryWrapper(final BufferedReader r) {
      myName = RW.readStringAttribute(r, "Library:");

      RW.readTag(r, "Classpath:");
      myClassPath = (List<String>) RW.readMany(r, RW.myStringReader, new ArrayList<String>());
    }
 public void write(final BufferedWriter w) {
   RW.writeln(w, "Library:" + myName);
   RW.writeln(w, "Classpath:");
   RW.writeln(w, myClassPath, RW.fromString);
 }