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
TheseFormattedStringelements 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 classFormatTokenElement.FormatTokenTypeThe 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, String aReplacement)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatTokenElement.FormatTokenTypegetType()StringtoFormattedString()Returns the elements' contents as a String with all necessary formatting tokens.StringtoUnformattedString()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, String aReplacement)
Creates a new instance.- Parameters:
aType- the token typeaReplacement- the replacement text
-
-
Method Detail
-
getType
public FormatTokenElement.FormatTokenType getType()
-
toUnformattedString
public String toUnformattedString()
Description copied from class:AbstractFormattedStringElementReturns the elements' contents as a String without any formatting tokens.- Specified by:
toUnformattedStringin classAbstractFormattedStringElement- Returns:
- the unformatted element contents
-
toFormattedString
public String toFormattedString()
Description copied from class:AbstractFormattedStringElementReturns the elements' contents as a String with all necessary formatting tokens.- Specified by:
toFormattedStringin classAbstractFormattedStringElement- Returns:
- the formatted element contents
-
-