|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IXmlObject
This is the base interface to use the implicit XML mapping.
A class implementing this interface will be able through simple naming rules, to:
Here are the naming rules:
_xmlparent_xmlroot_xmlattr_[req|opt]_[<name>]_xmlcontent_xmlnode_[req|opt]_[<name>]_xmlcollect_[req|opt]_[<name>]_xmlnode_[<min(int)>]_[<max(int)>|unb]_[<name>]_xmlcollect_[<min(int)>]_[<max(int)>|unb]_[<name>]Here is an example:
// --- Class mapped to an XML element named 'MyNode'
public class MyNode implements IXmlObject
{
// --- field mapped to the root object
private MyRoot _xmlroot;
// --- field mapped to the parent object
private MyParent _xmlparent;
// --- field mapped to mandatory string attribute with name 'ID'
private String _xmlattr_req_ID;
// --- field mapped to optional int attribute with name 'Length'
private String _xmlattr_opt_Length;
// --- field mapped to optional boolean attribute with name 'Bool'
private String _xmlattr_opt_Bool;
// --- field mapped to a mandatory child element in the child node with name 'Obj1'
private MyInterface1 _xmlnode_req_Obj1;
// --- field mapped to one or more children elements in the child node with name 'ArrayObj2'
private MyInterface2[] _xmlnode_1_unb_ArrayObj2;
// --- field mapped to one or two children elements right under the node
private MyClass3[] _xmlcollect_1_2_ArrayObj3;
public MyNode(XmlObject iParent, Element iNode, IInstanciationErrors iErrors)
{
super(iParent, iNode, iErrors);
}
[...]
}
Such a class may be instantiated with the following XML:
<MyRoot [...]>
[...]
<MyParent [...]>
[...]
<MyNode ID="node1" Length="12">
<Obj1>
<MyClass1 (implements MyInterface1) [...]>
[...]
</MyClass1>
</Obj1>
<ArrayObj2>
<MyClass2a (implements MyInterface2) [...]>
[...]
</MyClass2a>
<MyClass2b (implements MyInterface2) [...]>
[...]
</MyClass2b>
<MyClass2a [...]>
[...]
</MyClass2b>
</ArrayObj2>
<MyClass3 [...]>
[...]
</MyClass3>
<MyClass3 [...]>
[...]
</MyClass3>
</MyNode>
[...]
</MyParent [...]>
[...]
</MyRoot [...]>
XmlInstantiator,
XsdGenerator| Method Summary | |
|---|---|
void |
checkThisNode(java.lang.Object iValidSupport,
IValidityLogger iErrors)
This method is meant to check the validity of this object. |
| Method Detail |
|---|
void checkThisNode(java.lang.Object iValidSupport,
IValidityLogger iErrors)
iValidSupport - Object that gives support for checking validityiErrors - Object that allows logging validation errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||