Package de.gebit.integrity.string
Class FormatTokenElement
- java.lang.Object
-
- de.gebit.integrity.string.AbstractFormattedStringElement
-
- de.gebit.integrity.string.FormatTokenElement
-
public class FormatTokenElement extends AbstractFormattedStringElement
TheseFormattedString
elements are intended to represent single formatting tokens which don't "wrap" a piece of text. Examples are line breaks or tabs.- Author:
- Rene Schneider - initial API and implementation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FormatTokenElement.FormatTokenType
The format token types represent the actual tokens which can be used to format a string.
-
Constructor Summary
Constructors Constructor Description FormatTokenElement(FormatTokenElement.FormatTokenType aType)
Creates a new instance.FormatTokenElement(FormatTokenElement.FormatTokenType aType, java.lang.String aReplacement)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatTokenElement.FormatTokenType
getType()
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
-
FormatTokenElement
public FormatTokenElement(FormatTokenElement.FormatTokenType aType)
Creates a new instance.- Parameters:
aType
- the token type
-
FormatTokenElement
public FormatTokenElement(FormatTokenElement.FormatTokenType aType, java.lang.String aReplacement)
Creates a new instance.- Parameters:
aType
- the token typeaReplacement
- the replacement text
-
-
Method Detail
-
getType
public FormatTokenElement.FormatTokenType getType()
-
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
-
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
-
-