Interface SubstitutionMap.Initializable

All Superinterfaces:
SubstitutionMap
All Known Implementing Classes:
MinimalSubstitutionMap, PrefixingSubstitutionMap, RecordingSubstitutionMap, SplittingSubstitutionMap
Enclosing interface:
SubstitutionMap

public static interface SubstitutionMap.Initializable extends SubstitutionMap
A substitution map that can be reconsitituted from saved mappings.

This allows re-using a substitution map across multiple compile steps, and allows stability when incrementally recompiling part of a project.

Compilation starts with no rename map on disk, in which case no call to this method is necessary.

After the first compilation, RecordingSubstitutionMap#getRenameMap may be used with an OutputRenamingMapFormat to serialize the renaming map in a form that can be used with Closure Library code or Closure Templates.

Before a re-compile, OutputRenamingMapFormat.readRenamingMap(java.io.Reader) can be used to generate a set of initial mappings that can be passed to initializeWithMappings(java.util.Map<java.lang.String, java.lang.String>) to prepare a structurally equivalent substitution map to produce IDs that do not conflict with those generated by the one used for the previous compile.

Subsequent com

  • Method Details

    • initializeWithMappings

      void initializeWithMappings(Map<String,String> initialMappings)