public class ReplaceTextBuilderImpl extends Object implements ReplaceTextBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor and Description |
---|
ReplaceTextBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
String |
getFindText()
Retrieves the find text from the find text property.
|
String |
getReplaceText()
Retrieves the replace text from the replace text property.
|
String[] |
getText()
Retrieves the text from the text property.
|
void |
setFindText(String aFindText)
Sets the find text for the find text property.
|
void |
setReplaceText(String aReplaceText)
Sets the replace text for the replace text property.
|
void |
setText(String... aText)
Sets the text for the text property.
|
protected static String[] |
toReplaced(String[] aText,
String aFindText,
String aReplaceText) |
protected static int |
toReplaced(StringBuffer aTextBuffer,
String aFindText,
String aReplaceText)
Replaces a text by an other text in a StringBuffer.
|
protected static String |
toReplaced(String aText,
String aFindText,
String aReplaceText)
|
String |
toString()
The
String being build by the builder upon the settings of the
attributes. |
String |
toString(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
String[] |
toStrings()
The
String s being build by the builder upon the settings of
the attributes. |
String[] |
toStrings(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
B |
withText(Collection<String> aText)
Sets the text for the text property.
|
B |
withText(String... aText)
Sets the text for the text property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
withFindText, withReplaceText
getText
setText, setText
withText
toString
public String getReplaceText()
ReplaceTextBuilder
getReplaceText
in interface ReplaceTextBuilder
public void setReplaceText(String aReplaceText)
ReplaceTextBuilder
setReplaceText
in interface ReplaceTextBuilder
aReplaceText
- The replace text to be stored by the text align mode
property.public String getFindText()
ReplaceTextBuilder
getFindText
in interface ReplaceTextBuilder
public void setFindText(String aFindText)
ReplaceTextBuilder
setFindText
in interface ReplaceTextBuilder
aFindText
- The find text to be stored by the text align mode
property.public String[] toStrings() throws IllegalStateException
TextAccessor.TextProvider
String
s being build by the builder upon the settings of
the attributes.toStrings
in interface TextAccessor.TextProvider
String
arrayIllegalStateException
public String[] toStrings(String... aText)
Text
Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
.
Implementation requirements: This method must not(!) be implemented by
calling Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
(do
not change the text property) as this would not be thread safe!toStrings
in interface Text<ReplaceTextBuilder>
aText
- The text to be processed.String
arrayprotected static String[] toReplaced(String[] aText, String aFindText, String aReplaceText)
protected static int toReplaced(StringBuffer aTextBuffer, String aFindText, String aReplaceText)
aTextBuffer
- The buffer containing text with keywords.aFindText
- The text which has to be replaced.aReplaceText
- The text that should be places over the original.public String[] getText()
TextAccessor
getText
in interface TextAccessor
public void setText(String... aText)
TextAccessor.TextMutator
setText
in interface TextAccessor.TextMutator
aText
- The text to be stored by the text property.public B withText(String... aText)
TextAccessor.TextBuilder
public B withText(Collection<String> aText)
TextAccessor.TextBuilder
withText
in interface TextAccessor.TextBuilder<Text<B extends Text<B>>>
aText
- The text to be stored by the text property.public String toString()
String
being build by the builder upon the settings of the
attributes. The string array is returned as a single String
with
the operating system's end of line marker (CR on on Windows and CR LF on
*nix operating systems) as determined by
SystemUtility.getLineBreak()
toString
in interface TextAccessor.TextProvider
toString
in class Object
String
public String toString(String... aText)
Text
Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
.
Implementation requirements: This method must not(!) be implemented by
calling Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
(do
not change the text property) as this would not be thread safe!Copyright © 2017. All rights reserved.