Package com.google.common.css
Enum Class OutputRenamingMapFormat
- All Implemented Interfaces:
Serializable,Comparable<OutputRenamingMapFormat>,Constable
Defines the values for the --output-renaming-map-format flag in Closure
Stylesheets.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionReads/Writes the mapping as JSON, passed as an argument togoog.setCssNameMapping().Reads/Writes the mapping as JSON, passed as an argument togoog.setCssNameMapping()using the 'BY_WHOLE' mapping style.Before writing the mapping as CLOSURE_COMPILED, split the css name maps by hyphens and write out each piece individually.Reads/Writes the mapping as JSON, assigned to the global JavaScript variableCLOSURE_CSS_NAME_MAPPING.This is the current default behavior for output maps.Reads/Writes the mapping as JSON.Reads/Writes the mapping from/in a .properties file format, such that it can be read byProperties. -
Method Summary
Modifier and TypeMethodDescriptionReads 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 OutputRenamingMapFormatReturns the enum constant of this class with the specified name.static OutputRenamingMapFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.final voidwriteRenamingMap(Map<String, String> renamingMap, PrintWriter renamingMapWriter) LikewriteRenamingMap(java.util.Map, java.io.Writer)but does not throw when writes fail.voidwriteRenamingMap(Map<String, String> renamingMap, Writer renamingMapWriter) Writes the renaming map.
-
Enum Constant Details
-
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
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
Before writing the mapping as CLOSURE_COMPILED, split the css name maps by hyphens and write out each piece individually. seeCLOSURE_COMPILED -
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
Reads/Writes the mapping as JSON. -
PROPERTIES
Reads/Writes the mapping from/in a .properties file format, such that it can be read byProperties. -
JSCOMP_VARIABLE_MAP
This is the current default behavior for output maps. Still used for legacy reasons.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
writeRenamingMap
public void writeRenamingMap(Map<String, String> renamingMap, Writer renamingMapWriter) throws IOExceptionWrites the renaming map.- Throws:
IOException- See Also:
-
writeRenamingMap
LikewriteRenamingMap(java.util.Map, java.io.Writer)but does not throw when writes fail. -
readRenamingMap
public com.google.common.collect.ImmutableMap<String,String> readRenamingMap(Reader in) throws IOException 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.- Throws:
IOException
-