Package org.simpleframework.xml.filter
Class MapFilter
- java.lang.Object
-
- org.simpleframework.xml.filter.MapFilter
-
- All Implemented Interfaces:
Filter
public class MapFilter extends java.lang.Object implements Filter
TheMapFilter
object is a filter that can make use of user specified mappings for replacement. This filter can be given aMap
of name value pairs which will be used to resolve a value using the specified mappings. If there is no match found the filter will delegate to the provided filter.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
replace(java.lang.String text)
Replaces the text provided with the value resolved from the specifiedMap
.
-
-
-
Field Detail
-
filter
private Filter filter
This will resolve the replacement if no mapping is found.
-
map
private java.util.Map map
This contains a collection of user specified mappings.
-
-
Constructor Detail
-
MapFilter
public MapFilter(java.util.Map map)
Constructor for theMapFilter
object. This will use the specified mappings to resolve replacements. If this map does not contain a requested mapping null is resolved.- Parameters:
map
- this contains the user specified mappings
-
MapFilter
public MapFilter(java.util.Map map, Filter filter)
Constructor for theMapFilter
object. This will use the specified mappings to resolve replacements. If this map does not contain a requested mapping the provided filter is used to resolve the replacement text.- Parameters:
map
- this contains the user specified mappingsfilter
- this is delegated to if the map fails
-
-