|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.artenum.forceria.template.StringTemplate
public class StringTemplate
A string template is a string with the ability of replacing some special parts with some text. the replacement patterns are defined as the PATTERN_FORMAT enclosed with the 'enclosing char'
Constructor Summary | |
---|---|
StringTemplate()
Default Constructor. |
|
StringTemplate(String initialContent)
Constructor |
Method Summary | |
---|---|
static String |
escRegExp(String inStr)
This procedure is used to ensure that a string is not interpreted as a regular expression. |
String |
getContent()
get the initial content with enclosing patterns replaced by all added replacements |
Set<String> |
getPatterns()
get the set of patterns to be replaced |
boolean |
replace(StringTemplatePattern pattern,
String text)
replace a pattern composed of [CHAR]pattern[CHAR] by the given text, where [CHAR] is the defined enclosing char (which can be a string in fact) |
void |
reset()
reset the replacement process from the initial content |
void |
setInitialContent(String initialContent)
Set the initial content of the string to replace. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringTemplate()
public StringTemplate(String initialContent)
content
- Method Detail |
---|
public void reset()
public void setInitialContent(String initialContent)
initialContent
- public boolean replace(StringTemplatePattern pattern, String text)
pattern
- text
- public String getContent() throws StringTemplateException
StringTemplateException
public Set<String> getPatterns()
public static String escRegExp(String inStr)
strIn
- - a string that we want to ensure does not interfere with a regular expression.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |