Package com.dua3.utility.text
Class AttributeBasedConverter<T>
java.lang.Object
com.dua3.utility.text.AttributeBasedConverter<T>
- Type Parameters:
T- target type of conversion
- All Implemented Interfaces:
RichTextConverter<T>
- Direct Known Subclasses:
AnsiConverter,StyledDocumentConverter
Base class for attribute-based converters.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAbstract base class for the attribute-based converter implementation classes. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor for theAttributeBasedConverterclass. -
Method Summary
Modifier and TypeMethodDescriptionConvertRichTextinstance to the target class.protected abstract AttributeBasedConverter.AttributeBasedConverterImpl<T> createConverter(RichText text) Factory method to create a compatible converter implementation instance for this converter.
-
Constructor Details
-
AttributeBasedConverter
protected AttributeBasedConverter()Constructor for theAttributeBasedConverterclass.
-
-
Method Details
-
createConverter
protected abstract AttributeBasedConverter.AttributeBasedConverterImpl<T> createConverter(RichText text) Factory method to create a compatible converter implementation instance for this converter.- Parameters:
text- the text to be converted- Returns:
- instance of the implementation class
-
convert
ConvertRichTextinstance to the target class.- Specified by:
convertin interfaceRichTextConverter<T>- Parameters:
text- the text to convert- Returns:
- the conversion result
-