Enum OutputRenamingMapFormat

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<OutputRenamingMapFormat>

    public enum OutputRenamingMapFormat
    extends java.lang.Enum<OutputRenamingMapFormat>
    Defines the values for the --output-renaming-map-format flag in Closure Stylesheets.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CLOSURE_COMPILED
      Reads/Writes the mapping as JSON, passed as an argument to goog.setCssNameMapping().
      CLOSURE_COMPILED_BY_WHOLE
      Reads/Writes the mapping as JSON, passed as an argument to goog.setCssNameMapping() using the 'BY_WHOLE' mapping style.
      CLOSURE_COMPILED_SPLIT_HYPHENS
      Before writing the mapping as CLOSURE_COMPILED, split the css name maps by hyphens and write out each piece individually.
      CLOSURE_UNCOMPILED
      Reads/Writes the mapping as JSON, assigned to the global JavaScript variable CLOSURE_CSS_NAME_MAPPING.
      JSCOMP_VARIABLE_MAP
      This is the current default behavior for output maps.
      JSON
      Reads/Writes the mapping as JSON.
      PROPERTIES
      Reads/Writes the mapping from/in a .properties file format, such that it can be read by Properties.
    • Enum Constant Detail

      • CLOSURE_COMPILED

        public static final OutputRenamingMapFormat CLOSURE_COMPILED
        Reads/Writes the mapping as JSON, passed as an argument to goog.setCssNameMapping(). Designed for use with the Closure Library in compiled mode.
      • CLOSURE_COMPILED_BY_WHOLE

        public static final OutputRenamingMapFormat CLOSURE_COMPILED_BY_WHOLE
        Reads/Writes the mapping as JSON, passed as an argument to goog.setCssNameMapping() using the 'BY_WHOLE' mapping style. Designed for use with the Closure Library in compiled mode where the CSS name substitutions are taken as-is, which allows, e.g., using SimpleSubstitutionMap with class names containing hyphens.
      • CLOSURE_COMPILED_SPLIT_HYPHENS

        public static final OutputRenamingMapFormat CLOSURE_COMPILED_SPLIT_HYPHENS
        Before writing the mapping as CLOSURE_COMPILED, split the css name maps by hyphens and write out each piece individually. see CLOSURE_COMPILED
      • CLOSURE_UNCOMPILED

        public static final OutputRenamingMapFormat CLOSURE_UNCOMPILED
        Reads/Writes the mapping as JSON, assigned to the global JavaScript variable CLOSURE_CSS_NAME_MAPPING. Designed for use with the Closure Library in uncompiled mode.
      • PROPERTIES

        public static final OutputRenamingMapFormat PROPERTIES
        Reads/Writes the mapping from/in a .properties file format, such that it can be read by Properties.
      • JSCOMP_VARIABLE_MAP

        public static final OutputRenamingMapFormat JSCOMP_VARIABLE_MAP
        This is the current default behavior for output maps. Still used for legacy reasons.
    • Method Detail

      • values

        public static OutputRenamingMapFormat[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (OutputRenamingMapFormat c : OutputRenamingMapFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OutputRenamingMapFormat valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • writeRenamingMap

        public void writeRenamingMap​(java.util.Map<java.lang.String,​java.lang.String> renamingMap,
                                     java.io.Writer renamingMapWriter)
                              throws java.io.IOException
        Writes the renaming map.
        Throws:
        java.io.IOException
        See Also:
        #writeRenamingMap(Map, PrintWriter)
      • writeRenamingMap

        public final void writeRenamingMap​(java.util.Map<java.lang.String,​java.lang.String> renamingMap,
                                           java.io.PrintWriter renamingMapWriter)
        Like writeRenamingMap(java.util.Map, java.io.Writer) but does not throw when writes fail.