Package de.gebit.integrity.string
Class FormattedStringElement
- java.lang.Object
-
- de.gebit.integrity.string.AbstractFormattedStringElement
-
- de.gebit.integrity.string.FormattedStringElement
-
public class FormattedStringElement extends AbstractFormattedStringElement
This is the main element forFormattedString
s. It consists of a plain String value, to which an arbitrary number of formatting flags can be applied.- Author:
- Rene Schneider - initial API and implementation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FormattedStringElement.FormatFlag
Several formatting choices for text.
-
Constructor Summary
Constructors Constructor Description FormattedStringElement(java.lang.String aText)
Creates a new instance.FormattedStringElement(java.lang.String aText, FormattedStringElement.FormatFlag... someFlags)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<FormattedStringElement.FormatFlag>
getFormatFlags()
java.lang.String
toFormattedString()
Returns the elements' contents as a String with all necessary formatting tokens.java.lang.String
toUnformattedString()
Returns the elements' contents as a String without any formatting tokens.-
Methods inherited from class de.gebit.integrity.string.AbstractFormattedStringElement
equals, hashCode
-
-
-
-
Constructor Detail
-
FormattedStringElement
public FormattedStringElement(java.lang.String aText)
Creates a new instance.- Parameters:
aText
- the string value
-
FormattedStringElement
public FormattedStringElement(java.lang.String aText, FormattedStringElement.FormatFlag... someFlags)
Creates a new instance.- Parameters:
aText
- the string valuesomeFlags
- the formatting flags to apply
-
-
Method Detail
-
toUnformattedString
public java.lang.String toUnformattedString()
Description copied from class:AbstractFormattedStringElement
Returns the elements' contents as a String without any formatting tokens.- Specified by:
toUnformattedString
in classAbstractFormattedStringElement
- Returns:
- the unformatted element contents
-
getFormatFlags
public java.util.List<FormattedStringElement.FormatFlag> getFormatFlags()
-
toFormattedString
public java.lang.String toFormattedString()
Description copied from class:AbstractFormattedStringElement
Returns the elements' contents as a String with all necessary formatting tokens.- Specified by:
toFormattedString
in classAbstractFormattedStringElement
- Returns:
- the formatted element contents
-
-