Package cdc.util.xml

Interface XmlElementWriter<T,​D>

  • Type Parameters:
    T - The object type.
    D - The data type.

    public interface XmlElementWriter<T,​D>
    Interface implemented by classes that can write an object to an XmlHandler as an element.
    Author:
    Damien Carbonne
    • Method Detail

      • getObjectClass

        Class<T> getObjectClass()
        Returns:
        The class of objects that can be written.
      • getDataClass

        Class<D> getDataClass()
        Returns:
        The class of associated data.
      • writeElement

        void writeElement​(XmlHandler handler,
                          String name,
                          T object,
                          D data)
                   throws IOException
        Writes an object as an element.
        Parameters:
        handler - The XML handler.
        name - The name of the element.
        object - The object to print.
        data - Data that can be used to write object.
        Throws:
        IOException - When an IO error occurs.