Class StringBasedMicroTypeConverter<T>

  • Type Parameters:
    T - Effective data type
    All Implemented Interfaces:
    IMicroTypeConverter<T>

    public final class StringBasedMicroTypeConverter<T>
    extends Object
    implements IMicroTypeConverter<T>
    An implementation if IMicroTypeConverter that uses a regular type converter conversion (see TypeConverter) from and to string for conversion.
    Author:
    Philip Helger
    • Constructor Detail

      • StringBasedMicroTypeConverter

        public StringBasedMicroTypeConverter​(@Nonnull
                                             Class<T> aNativeClass)
    • Method Detail

      • convertToMicroElement

        @Nonnull
        public IMicroElement convertToMicroElement​(@Nonnull
                                                   T aObject,
                                                   @Nullable
                                                   String sNamespaceURI,
                                                   @Nonnull @Nonempty
                                                   String sTagName)
        Description copied from interface: IMicroTypeConverter
        Convert the passed object to a micro element using the specified tag name
        Specified by:
        convertToMicroElement in interface IMicroTypeConverter<T>
        Parameters:
        aObject - The object to be converted. May not be null.
        sNamespaceURI - The namespace URI for the element to be created. May be null.
        sTagName - The tag name to be used. May neither be null nor empty.
        Returns:
        null in case creation failed. A micro element with the specified namespace and tag name otherwise.