public class EscapeTextBuilderImpl extends Object implements EscapeTextBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor and Description |
---|
EscapeTextBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
EscapeTextBuilder |
addEscapeProperty(org.refcodes.structure.Property aProperty) |
EscapeTextBuilder |
addEscapeProperty(String aKey,
String aValue) |
org.refcodes.structure.Property[] |
getEscapeProperties() |
EscapeTextMode |
getEscapeTextMode()
Retrieves the escape text mode from the escape text mode property.
|
String[] |
getText()
Retrieves the text from the text property.
|
void |
setEscapeProperties(org.refcodes.structure.Property... aProperties) |
void |
setEscapeTextMode(EscapeTextMode aEscapeTextMode)
Sets the escape text mode for the escape text mode property.
|
void |
setText(String... aText)
Sets the text for the text property.
|
protected String[] |
toEscaped(String[] aText,
List<org.refcodes.structure.Property> aProperties,
EscapeTextMode aEscapeTextMode) |
protected String |
toEscaped(String aText,
List<org.refcodes.structure.Property> aProperties,
EscapeTextMode aEscapeTextMode) |
static String |
toEscaped(String aUnEscaped,
String[][] aEscapeMatrix)
Escapes a text using the provided escape matrix which must be a two
dimensional array with two elements per line and where the element at
position 0 (of a line) represents the character and the element at
position 1 (of a line) the escaped character.
|
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 escaped by the builder upon the settings of the
attributes. |
String[] |
toStrings(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
static String |
toUnEscaped(String aEscaped,
String[][] aEscapeMatrix)
Unescapes a text using the provided escape matrix which must be a two
dimensional array with two elements per line and where the element at
position 0 (of a line) represents the character and the element at
position 1 (of a line) the escaped character.
|
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
toString, withEscapeProperties, withEscapeTextMode
getText
setText, setText
withText
public EscapeTextMode getEscapeTextMode()
EscapeTextBuilder
getEscapeTextMode
in interface EscapeTextBuilder
public void setEscapeTextMode(EscapeTextMode aEscapeTextMode)
EscapeTextBuilder
setEscapeTextMode
in interface EscapeTextBuilder
aEscapeTextMode
- The escape text mode to be stored by the align text
mode property.public org.refcodes.structure.Property[] getEscapeProperties()
getEscapeProperties
in interface EscapeTextBuilder
public void setEscapeProperties(org.refcodes.structure.Property... aProperties)
setEscapeProperties
in interface EscapeTextBuilder
public EscapeTextBuilder addEscapeProperty(org.refcodes.structure.Property aProperty)
addEscapeProperty
in interface EscapeTextBuilder
public EscapeTextBuilder addEscapeProperty(String aKey, String aValue)
addEscapeProperty
in interface EscapeTextBuilder
public String[] toStrings() throws IllegalStateException
EscapeTextBuilder
String
s being escaped by the builder upon the settings of the
attributes.toStrings
in interface EscapeTextBuilder
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<EscapeTextBuilder>
aText
- The text to be processed.String
arrayprotected String[] toEscaped(String[] aText, List<org.refcodes.structure.Property> aProperties, EscapeTextMode aEscapeTextMode)
protected String toEscaped(String aText, List<org.refcodes.structure.Property> aProperties, EscapeTextMode aEscapeTextMode)
public static String toEscaped(String aUnEscaped, String[][] aEscapeMatrix)
aUnEscaped
- The text to be escaped.aEscapeMatrix
- The matrix to be used for escaping.public static String toUnEscaped(String aEscaped, String[][] aEscapeMatrix)
aEscaped
- The text to be unescaped.aEscapeMatrix
- The matrix to be used for unescaping.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.