EscapeTextBuilder
, Text<EscapeTextBuilder>
, TextAccessor
, TextAccessor.TextBuilder<Text<EscapeTextBuilder>>
, TextAccessor.TextMutator
, TextAccessor.TextProperty
, TextAccessor.TextProvider
public class EscapeTextBuilderImpl extends Object implements EscapeTextBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor | Description |
---|---|
EscapeTextBuilderImpl() |
Modifier and Type | Method | Description |
---|---|---|
EscapeTextBuilder |
addEscapeProperty(String aKey,
String aValue) |
Adds the escape property.
|
EscapeTextBuilder |
addEscapeProperty(org.refcodes.structure.Property aProperty) |
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.
|
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.
|
protected String |
toEscaped(String aText,
List<org.refcodes.structure.Property> aProperties,
EscapeTextMode aEscapeTextMode) |
To escaped.
|
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...)
followed by TextAccessor.TextProvider.toString() . |
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...)
followed by TextAccessor.TextProvider.toStrings() . |
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(String... aText) |
With text.
|
B |
withText(Collection<String> aText) |
With text.
|
toString, withEscapeProperties, withEscapeTextMode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getText
withText
setText, setText
public EscapeTextMode getEscapeTextMode()
getEscapeTextMode
in interface EscapeTextBuilder
public void setEscapeTextMode(EscapeTextMode aEscapeTextMode)
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
aProperties
- the new escape propertiespublic EscapeTextBuilder addEscapeProperty(org.refcodes.structure.Property aProperty)
addEscapeProperty
in interface EscapeTextBuilder
aProperty
- the propertypublic EscapeTextBuilder addEscapeProperty(String aKey, String aValue)
addEscapeProperty
in interface EscapeTextBuilder
aKey
- the keyaValue
- the valuepublic String[] toStrings() throws IllegalStateException
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.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 textaProperties
- the propertiesaEscapeTextMode
- the escape text modeprotected String toEscaped(String aText, List<org.refcodes.structure.Property> aProperties, EscapeTextMode aEscapeTextMode)
aText
- the textaProperties
- the propertiesaEscapeTextMode
- the 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()
getText
in interface TextAccessor
public void setText(String... aText)
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<B extends Text<B>>
aText
- the textpublic String toString()
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.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 © 2018. All rights reserved.