Package com.google.common.css
Enum OutputRenamingMapFormat
- java.lang.Object
-
- java.lang.Enum<OutputRenamingMapFormat>
-
- com.google.common.css.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_COMPILEDReads/Writes the mapping as JSON, passed as an argument togoog.setCssNameMapping().CLOSURE_COMPILED_BY_WHOLEReads/Writes the mapping as JSON, passed as an argument togoog.setCssNameMapping()using the 'BY_WHOLE' mapping style.CLOSURE_COMPILED_SPLIT_HYPHENSBefore writing the mapping as CLOSURE_COMPILED, split the css name maps by hyphens and write out each piece individually.CLOSURE_UNCOMPILEDReads/Writes the mapping as JSON, assigned to the global JavaScript variableCLOSURE_CSS_NAME_MAPPING.JSCOMP_VARIABLE_MAPThis is the current default behavior for output maps.JSONReads/Writes the mapping as JSON.PROPERTIESReads/Writes the mapping from/in a .properties file format, such that it can be read byProperties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>readRenamingMap(java.io.Reader in)Reads the output ofwriteRenamingMap(java.util.Map<java.lang.String, java.lang.String>, java.io.Writer)so a renaming map can be reused from one compile to another.static OutputRenamingMapFormatvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static OutputRenamingMapFormat[]values()Returns an array containing the constants of this enum type, in the order they are declared.voidwriteRenamingMap(java.util.Map<java.lang.String,java.lang.String> renamingMap, java.io.PrintWriter renamingMapWriter)LikewriteRenamingMap(java.util.Map, java.io.Writer)but does not throw when writes fail.voidwriteRenamingMap(java.util.Map<java.lang.String,java.lang.String> renamingMap, java.io.Writer renamingMapWriter)Writes the renaming map.
-
-
-
Enum Constant Detail
-
CLOSURE_COMPILED
public static final OutputRenamingMapFormat CLOSURE_COMPILED
Reads/Writes the mapping as JSON, passed as an argument togoog.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 togoog.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., usingSimpleSubstitutionMapwith 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. seeCLOSURE_COMPILED
-
CLOSURE_UNCOMPILED
public static final OutputRenamingMapFormat CLOSURE_UNCOMPILED
Reads/Writes the mapping as JSON, assigned to the global JavaScript variableCLOSURE_CSS_NAME_MAPPING. Designed for use with the Closure Library in uncompiled mode.
-
JSON
public static final OutputRenamingMapFormat JSON
Reads/Writes the mapping as JSON.
-
PROPERTIES
public static final OutputRenamingMapFormat PROPERTIES
Reads/Writes the mapping from/in a .properties file format, such that it can be read byProperties.
-
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 namejava.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.IOExceptionWrites 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)LikewriteRenamingMap(java.util.Map, java.io.Writer)but does not throw when writes fail.
-
readRenamingMap
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> readRenamingMap(java.io.Reader in) throws java.io.IOExceptionReads the output ofwriteRenamingMap(java.util.Map<java.lang.String, java.lang.String>, java.io.Writer)so a renaming map can be reused from one compile to another.- Throws:
java.io.IOException
-
-