public interface XmlDispatchedStorable extends XmlStorable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
XML_ATTR_READ_METHOD |
Modifier and Type | Method and Description |
---|---|
static <T> T |
fromXmlElement(org.w3c.dom.Element element,
java.lang.String xmlTag,
java.lang.Class<T> type)
Recreate an object of the given class from its stored XML representation.
|
java.lang.String |
getXmlReaderMethod()
Get the method used to reread an object of this kind from XML.
|
void |
storeInnerXml(SimpleXmlWriter xml)
Store the individual XML
|
default void |
storeOuterXml(SimpleXmlWriter xml,
java.lang.String xmlTag)
Write this dispatched storable to XML using the given XML tag.
|
storeXml
@NotNull static final java.lang.String XML_ATTR_READ_METHOD
default void storeOuterXml(@NotNull SimpleXmlWriter xml, @NotNull java.lang.String xmlTag)
storeInnerXml(SimpleXmlWriter)
is creating.
This method is assumed to be called from parent class/interfaces implementations.
xml
- XML writerxmlTag
- XML tagvoid storeInnerXml(@NotNull SimpleXmlWriter xml)
xml
- XML writer@NotNull java.lang.String getXmlReaderMethod()
Element
argument
and return an object of the stored kind.
The reader is expected to ignore the exact element and restore the object from the children of the given element. This is the reverse of what has happened during storeInnerXml(SimpleXmlWriter).
"full.class.name#methodName"
@NotNull static <T> T fromXmlElement(@NotNull org.w3c.dom.Element element, @NotNull java.lang.String xmlTag, @NotNull java.lang.Class<T> type) throws org.xml.sax.SAXException
T
- type of objectelement
- outer XML element as created by storeOuterXml(SimpleXmlWriter, String)
xmlTag
- outer XML tag used for storagetype
- type of stored objectorg.xml.sax.SAXException
- on read, access or format errors