Package com.helger.xml.microdom.convert
Interface IMicroTypeConverter<T>
- Type Parameters:
T- Data type to handle.
- All Known Implementing Classes:
ColorMicroTypeConverter,MimeTypeInfoMicroTypeConverter,MultilingualTextMicroTypeConverterRegistrar.MultilingualTextConverter,MultilingualTextMicroTypeConverterRegistrar.ReadOnlyMultilingualTextConverter,StringBasedMicroTypeConverter,StringMicroTypeConverter
public interface IMicroTypeConverter<T>
Interface to be implemented to marshal between IMicroElement and a native
object.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault IMicroElementconvertToMicroElement(T aObject, String sTagName) Convert the passed object to a micro element using the specified tag name and anullnamespace URI.convertToMicroElement(T aObject, String sNamespaceURI, String sTagName) Convert the passed object to a micro element using the specified tag nameconvertToNative(IMicroElement aElement) Convert the passed object to a native element.
-
Method Details
-
convertToMicroElement
@Nullable default IMicroElement convertToMicroElement(@Nonnull T aObject, @Nonnull @Nonempty String sTagName) Convert the passed object to a micro element using the specified tag name and anullnamespace URI.- Parameters:
aObject- The object to be converted. May not benull.sTagName- The tag name to be used. May neither benullnor empty.- Returns:
nullin case creation failed. A micro element with the specified namespace and tag name otherwise.
-
convertToMicroElement
@Nullable IMicroElement convertToMicroElement(@Nonnull T aObject, @Nullable String sNamespaceURI, @Nonnull @Nonempty String sTagName) Convert the passed object to a micro element using the specified tag name- Parameters:
aObject- The object to be converted. May not benull.sNamespaceURI- The namespace URI for the element to be created. May benull.sTagName- The tag name to be used. May neither benullnor empty.- Returns:
nullin case creation failed. A micro element with the specified namespace and tag name otherwise.
-
convertToNative
Convert the passed object to a native element.- Parameters:
aElement- The micro element to be converted.- Returns:
nullif conversion to a native object failed.
-