Package com.helger.xml.microdom.convert
Class StringBasedMicroTypeConverter<T>
java.lang.Object
com.helger.xml.microdom.convert.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToMicroElement(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.xml.microdom.convert.IMicroTypeConverter
convertToMicroElement
-
Constructor Details
-
StringBasedMicroTypeConverter
-
-
Method Details
-
convertToMicroElement
@Nonnull public IMicroElement convertToMicroElement(@Nonnull T aObject, @Nullable String sNamespaceURI, @Nonnull @Nonempty String sTagName) Description copied from interface:IMicroTypeConverterConvert the passed object to a micro element using the specified tag name- Specified by:
convertToMicroElementin interfaceIMicroTypeConverter<T>- 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
Description copied from interface:IMicroTypeConverterConvert the passed object to a native element.- Specified by:
convertToNativein interfaceIMicroTypeConverter<T>- Parameters:
aElement- The micro element to be converted.- Returns:
nullif conversion to a native object failed.
-