Package com.google.common.css
Class SimpleSubstitutionMap
java.lang.Object
com.google.common.css.SimpleSubstitutionMap
- All Implemented Interfaces:
SubstitutionMap
A SubstitutionMap that trivially renames its CSS classes by adding an
underscore. This may be helpful in debugging because it makes it easy to
match the renamed value with the original while helping catch bugs where the
CSS class name is hardcoded in the code. Example in Soy:
// Case I: Hardcoded name (incorrect)
<div class="CSS_MENU_BAR"></div>
// Case II: Name used as variable (correct)
<div class="{css CSS_MENU_BAR}"></div>
In Case I, the div would not get the effects of the CSS class when it is renamed, so hopefully the missing styles would help discover the source of the error.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.css.SubstitutionMap
SubstitutionMap.Initializable -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SimpleSubstitutionMap
public SimpleSubstitutionMap()
-
-
Method Details
-
get
Gets the string that should be substituted forkey. The same value must be consistently returned for any particularkey, and the returned value must not be returned for any otherkeyvalue.- Specified by:
getin interfaceSubstitutionMap- Parameters:
key- the text to be replaced (never null)- Returns:
- the value to substitute for
key - Throws:
IllegalArgumentException- if key is null
-