public class ChoiceXmlObjectFactory<T> extends XmlObjectFactory<T> implements XmlSinkWritable
Modifier and Type | Class and Description |
---|---|
static class |
ChoiceXmlObjectFactory.Option |
_supportedClass
ARRAY_MAKER
Constructor and Description |
---|
ChoiceXmlObjectFactory(java.lang.Class<T> supportedClass,
ChoiceXmlObjectFactory.Option[] options) |
ChoiceXmlObjectFactory(java.lang.Class<T> supportedClass,
MainXmlObjectFactory<?>[] factories) |
Modifier and Type | Method and Description |
---|---|
T |
extractFromNode(TagNode node)
Implementations must extract information from the node, but must NOT invoke
verifyNoMoreChildren on the node.
|
void |
mostToXml(XmlSink xmlSink,
java.lang.String relativeName,
XmlNameSpace nameSpace)
Causes instance to write itself to XML except that it doesn't
start the node nor writes the closing tag.
|
TagNodeId |
naturalTagNodeId()
When writing instances of this class, the id returned
by this function will be used unless alternative
identification is supplied.
|
T |
nextOnParentN(TagNode parentNode,
java.lang.String relativeName,
XmlNameSpace nameSpace)
Finds the next node on parent.
|
determineSupportedClass, extractArrayFromNode, extractArrayFromNode, extractArrayFromNode, extractArrayFromNode, extractListFromNode, extractListFromNode, extractListFromNode, extractListFromNode, fileToArray, fileToArray, fileToArray, fileToArray, fileToArray, fileToArray, fileToObject, fileToObject, nextArrayFromParentE, nextArrayFromParentE, nextArrayFromParentE, nextArrayFromParentE, nextArrayFromParentE, nextArrayFromParentE, nextArrayFromParentN, nextArrayFromParentN, nextArrayFromParentN, nextArrayFromParentN, nextArrayFromParentN, nextArrayFromParentN, nextChildNodeN, nextListFromParentE, nextListFromParentE, nextListFromParentE, nextListFromParentE, nextListFromParentE, nextListFromParentE, nextListFromParentN, nextListFromParentN, nextListFromParentN, nextListFromParentN, nextListFromParentN, nextListFromParentN, nextOnParentD, nextOnParentD, nextOnParentD, nextOnParentE, nextOnParentE, nextOnParentE, nextOnParentN, nextOnParentN, stringToArray, stringToArray, stringToArray, stringToArray, stringToArray, stringToArray, stringToObject, stringToObject
public ChoiceXmlObjectFactory(java.lang.Class<T> supportedClass, ChoiceXmlObjectFactory.Option[] options)
public ChoiceXmlObjectFactory(java.lang.Class<T> supportedClass, MainXmlObjectFactory<?>[] factories)
public T extractFromNode(TagNode node)
XmlObjectFactory
This arrangement also makes it easier to handle inheritance because typically implementation functions will call the constructor of T and there may or may not be subclasses of T which pull out additional fields.
extractFromNode
in class XmlObjectFactory<T>
public T nextOnParentN(TagNode parentNode, java.lang.String relativeName, XmlNameSpace nameSpace)
XmlObjectFactory
nextOnParentN
in class XmlObjectFactory<T>
parentNode
- The node we are extracting the next node fromrelativeName
- Of the next node. Null means any node will do.nameSpace
- Of the next node. Null means no name spacepublic TagNodeId naturalTagNodeId()
XmlSinkWritable
naturalTagNodeId
in interface XmlSinkWritable
naturalTagNodeId
in class XmlObjectFactory<T>
public void mostToXml(XmlSink xmlSink, java.lang.String relativeName, XmlNameSpace nameSpace)
XmlSinkWritable
mostToXml
in interface XmlSinkWritable
mostToXml
in class XmlObjectFactory<T>
xmlSink
- Where the XML is writtenrelativeName
- or simple node name. May not be needed but is available.nameSpace
- or null for simple node names. May not be needed but is available.