Package com.google.common.css
Class RecordingSubstitutionMap
- java.lang.Object
-
- com.google.common.css.RecordingSubstitutionMap
-
- All Implemented Interfaces:
SubstitutionMap,SubstitutionMap.Initializable
public class RecordingSubstitutionMap extends java.lang.Object implements SubstitutionMap.Initializable
A decorator for aSubstitutionMapthat records which values it maps.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRecordingSubstitutionMap.BuilderA-la-carte builder.-
Nested classes/interfaces inherited from interface com.google.common.css.SubstitutionMap
SubstitutionMap.Initializable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringget(java.lang.String key)Gets the string that should be substituted forkey.java.util.Map<java.lang.String,java.lang.String>getMappings()voidinitializeWithMappings(java.util.Map<? extends java.lang.String,? extends java.lang.String> newMappings)
-
-
-
Method Detail
-
get
public java.lang.String get(java.lang.String key)
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:
java.lang.NullPointerException- if key is null.
-
getMappings
public java.util.Map<java.lang.String,java.lang.String> getMappings()
- Returns:
- The recorded mappings in the order they were created. This output may be used with
OutputRenamingMapFormat.writeRenamingMap(java.util.Map<java.lang.String, java.lang.String>, java.io.Writer)
-
initializeWithMappings
public void initializeWithMappings(java.util.Map<? extends java.lang.String,? extends java.lang.String> newMappings)
- Specified by:
initializeWithMappingsin interfaceSubstitutionMap.Initializable
-
-