1 package org.apache.oro.text.regex; 2 3 59 60 74 public class StringSubstitution implements Substitution { 75 int _subLength; 76 String _substitution; 77 78 82 public StringSubstitution() { 83 this(""); 84 } 85 86 91 public StringSubstitution(String substitution) { 92 setSubstitution(substitution); 93 } 94 95 96 104 public void setSubstitution(String substitution) { 105 _substitution = substitution; 106 _subLength = substitution.length(); 107 } 108 109 114 public String getSubstitution() { return _substitution; } 115 116 121 public String toString() { return getSubstitution(); } 122 123 140 public void appendSubstitution(StringBuffer appendBuffer, MatchResult match, 141 int substitutionCount, String originalInput, 142 PatternMatcher matcher, Pattern pattern) 143 { 144 if(_subLength == 0) 145 return; 146 appendBuffer.append(_substitution); 147 } 148 } 149 | Popular Tags |