Class SimilarNamedWays.RegExprRule
- java.lang.Object
-
- org.openstreetmap.josm.data.validation.tests.SimilarNamedWays.RegExprRule
-
- All Implemented Interfaces:
SimilarNamedWays.NormalizeRule
- Enclosing class:
- SimilarNamedWays
public static class SimilarNamedWays.RegExprRule extends Object implements SimilarNamedWays.NormalizeRule
A rule to replace by regular expression, so that all strings matching the regular expression are handled as if they werereplacement
-
-
Field Summary
Fields Modifier and Type Field Description private Pattern
regExpr
private String
replacement
-
Constructor Summary
Constructors Constructor Description RegExprRule(String expression, String replacement)
Create a new rule to replace by regular expression
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
normalize(String name)
Normalize the string by replacing parts.String
toString()
-
-
-
Field Detail
-
replacement
private final String replacement
-
-
Constructor Detail
-
RegExprRule
public RegExprRule(String expression, String replacement)
Create a new rule to replace by regular expression- Parameters:
expression
- The regular expressionreplacement
- The replacement
-
-
Method Detail
-
normalize
public String normalize(String name)
Description copied from interface:SimilarNamedWays.NormalizeRule
Normalize the string by replacing parts.- Specified by:
normalize
in interfaceSimilarNamedWays.NormalizeRule
- Parameters:
name
- name to normalize- Returns:
- normalized string
-
-