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

public abstract class AttributeBasedConverter<T> extends Object implements RichTextConverter<T>
Base class for attribute-based converters.
  • Constructor Details

    • AttributeBasedConverter

      protected AttributeBasedConverter()
      Constructor for the AttributeBasedConverter class.
  • 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

      public T convert(RichText text)
      Convert RichText instance to the target class.
      Specified by:
      convert in interface RichTextConverter<T>
      Parameters:
      text - the text to convert
      Returns:
      the conversion result