org.codelabor.system.pattern.service
Class RegexPatternReplacerImpl
java.lang.Object
org.codelabor.system.pattern.service.AbstractPatternReplacer
org.codelabor.system.pattern.service.RegexPatternReplacerImpl
- All Implemented Interfaces:
- PatternReplacer, org.springframework.beans.factory.InitializingBean
public class RegexPatternReplacerImpl
- extends AbstractPatternReplacer
Regex 패턴 리플레이서 구현 클래스
정규 표현식으로 표현된 패턴에 대해 치환을 확인할 수 있는 패턴 리플레이서
- Author:
- Shin Sang-jae
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexPatternReplacerImpl
public RegexPatternReplacerImpl()
replace
public String replace(String targetString)
- Description copied from interface:
PatternReplacer
- 문자열을 치환한다.
내장된 규칙에 따라 문자열을 치환한다.
- Specified by:
replace
in interface PatternReplacer
- Specified by:
replace
in class AbstractPatternReplacer
- Parameters:
targetString
- 치환 대상 문자열
- Returns:
- 치환된 문자열
replace
public String replace(String searchPattern,
String replacePattern,
String targetString)
- Description copied from interface:
PatternReplacer
- 문자열을 치환한다.
검색 패턴을 찾아 치환 패턴에 해당하는 형태로 문자열을 치환한다.
- Specified by:
replace
in interface PatternReplacer
- Specified by:
replace
in class AbstractPatternReplacer
- Parameters:
searchPattern
- 검색 패턴replacePattern
- 치환 패턴targetString
- 치환 대상 문자열
- Returns:
- 치환된 문자열
replace
public String replace(Map<String,String> searchAndReplacePatternMap,
String targetString)
- Description copied from interface:
PatternReplacer
- 문자열을 치환한다.
Map의 Key에 해당하는 패턴을 찾아 Map의 Value에 해당하는 형태로 문자열을 치환한다.
- Specified by:
replace
in interface PatternReplacer
- Specified by:
replace
in class AbstractPatternReplacer
- Parameters:
searchAndReplacePatternMap
- 패턴 MaptargetString
- 치환 대상 문자열
- Returns:
- 치환된 문자열
replace
public String replace(Map<String,String> searchAndReplacePatternMap,
List<String> excludesPatternMap,
String targetString)
- Description copied from interface:
PatternReplacer
- 문자열을 치환한다.
포함할 패턴 Map의 Key에 해당하는 패턴을 찾아 Map의 Value에 해당하는 형태로 문자열을 치환한다.
단, 제외 패턴 List에 해당된다면 치환하지 않는다.
- Specified by:
replace
in interface PatternReplacer
- Specified by:
replace
in class AbstractPatternReplacer
- Parameters:
searchAndReplacePatternMap
- 포함할 패턴 MapexcludesPatternMap
- 제외할 패턴 List *targetString
- 치환 대상 문자열
- Returns:
- 치환된 문자열
Copyright © 2011 CODELABOR. All Rights Reserved.