Package com.helger.tree.xml
Class MicroTypeConverterTreeXML<DATATYPE>
- java.lang.Object
-
- com.helger.tree.xml.MicroTypeConverterTreeXML<DATATYPE>
-
- Type Parameters:
DATATYPE- The data type to be converted
- All Implemented Interfaces:
IConverterMicroNodeToTreeItem<DATATYPE>,IConverterTreeItemToMicroNode<DATATYPE>,IConverterTreeXML<DATATYPE>
@NotThreadSafe public final class MicroTypeConverterTreeXML<DATATYPE> extends Object implements IConverterTreeXML<DATATYPE>
A special implementation ofIConverterTreeXMLthat uses the conversion rules stored in theMicroTypeConverterRegistry.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description MicroTypeConverterTreeXML(String sElementName, Class<? extends DATATYPE> aNativeClass)ConstructorMicroTypeConverterTreeXML(String sNamespaceURI, String sElementName, Class<? extends DATATYPE> aNativeClass)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendDataValue(com.helger.xml.microdom.IMicroElement eDataElement, DATATYPE aObject)static <DATATYPE> MicroTypeConverterTreeXML<DATATYPE>create(String sElementName, Class<? extends DATATYPE> aNativeClass)Factory method.static <DATATYPE> MicroTypeConverterTreeXML<DATATYPE>create(String sNamespaceURI, String sElementName, Class<? extends DATATYPE> aNativeClass)Factory methodDATATYPEgetAsDataValue(com.helger.xml.microdom.IMicroElement eDataElement)StringgetElementName()StringgetNamespaceURI()Class<? extends DATATYPE>getNativeClass()
-
-
-
Constructor Detail
-
MicroTypeConverterTreeXML
public MicroTypeConverterTreeXML(@Nonnull @Nonempty String sElementName, @Nonnull Class<? extends DATATYPE> aNativeClass)
Constructor- Parameters:
sElementName- The element name to use. May neither benullnor emptyaNativeClass- The data type class - required for reading. May be in an interface as well.
-
MicroTypeConverterTreeXML
public MicroTypeConverterTreeXML(@Nullable String sNamespaceURI, @Nonnull @Nonempty String sElementName, @Nonnull Class<? extends DATATYPE> aNativeClass)
Constructor- Parameters:
sNamespaceURI- The namespace URI for the created element. May benull.sElementName- The element name to use. May neither benullnor emptyaNativeClass- The data type class - required for reading. May be in an interface as well.
-
-
Method Detail
-
getNamespaceURI
@Nullable public String getNamespaceURI()
- Specified by:
getNamespaceURIin interfaceIConverterMicroNodeToTreeItem<DATATYPE>- Specified by:
getNamespaceURIin interfaceIConverterTreeItemToMicroNode<DATATYPE>
-
appendDataValue
public void appendDataValue(@Nonnull com.helger.xml.microdom.IMicroElement eDataElement, @Nullable DATATYPE aObject)
- Specified by:
appendDataValuein interfaceIConverterTreeItemToMicroNode<DATATYPE>
-
getAsDataValue
@Nullable public DATATYPE getAsDataValue(@Nonnull com.helger.xml.microdom.IMicroElement eDataElement)
- Specified by:
getAsDataValuein interfaceIConverterMicroNodeToTreeItem<DATATYPE>
-
create
@Nonnull public static <DATATYPE> MicroTypeConverterTreeXML<DATATYPE> create(@Nonnull @Nonempty String sElementName, @Nonnull Class<? extends DATATYPE> aNativeClass)
Factory method.- Type Parameters:
DATATYPE- The data type to be converted- Parameters:
sElementName- The element name to use. May neither benullnor emptyaNativeClass- The data type class - required for reading. May be in an interface as well.- Returns:
- Never
null.
-
create
@Nonnull public static <DATATYPE> MicroTypeConverterTreeXML<DATATYPE> create(@Nullable String sNamespaceURI, @Nonnull @Nonempty String sElementName, @Nonnull Class<? extends DATATYPE> aNativeClass)
Factory method- Type Parameters:
DATATYPE- The data type to be converted- Parameters:
sNamespaceURI- The namespace URI for the created element. May benull.sElementName- The element name to use. May neither benullnor emptyaNativeClass- The data type class - required for reading. May be in an interface as well.- Returns:
- Never
null.
-
-