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)
Adds the escape property.
|
EscapeTextBuilder |
addEscapeProperty(String aKey,
String aValue)
Adds the escape property.
|
org.refcodes.structure.Property[] |
getEscapeProperties()
Gets the escape properties.
|
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)
Sets the escape properties.
|
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)
To escaped.
|
protected String |
toEscaped(String aText,
List<org.refcodes.structure.Property> aProperties,
EscapeTextMode aEscapeTextMode)
To escaped.
|
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)
With text.
|
B |
withText(String... aText)
With text.
|
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()
EscapeTextBuilder
getEscapeProperties
in interface EscapeTextBuilder
public void setEscapeProperties(org.refcodes.structure.Property... aProperties)
EscapeTextBuilder
setEscapeProperties
in interface EscapeTextBuilder
aProperties
- the new escape propertiespublic EscapeTextBuilder addEscapeProperty(org.refcodes.structure.Property aProperty)
EscapeTextBuilder
addEscapeProperty
in interface EscapeTextBuilder
aProperty
- the a propertypublic EscapeTextBuilder addEscapeProperty(String aKey, String aValue)
EscapeTextBuilder
addEscapeProperty
in interface EscapeTextBuilder
aKey
- the a keyaValue
- the a valuepublic 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)
aText
- the a textaProperties
- the a propertiesaEscapeTextMode
- the a escape text modeprotected String toEscaped(String aText, List<org.refcodes.structure.Property> aProperties, EscapeTextMode aEscapeTextMode)
aText
- the a textaProperties
- the a propertiesaEscapeTextMode
- the a escape text modepublic 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)
public B withText(Collection<String> aText)
withText
in interface TextAccessor.TextBuilder<Text<B extends Text<B>>>
aText
- the a textpublic String toString()
TextAccessor.TextProvider
String
being build by the builder upon the settings of
the attributes. In case more then one line has been set as input and
the functionality of the builder is applied to each line in separate,
then this method returns all of them lines concatenated with a line
break between each of them (implementation depended).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.