DEE

数据交换


Document.Element

<p><strong>简要描述:</strong> </p> <ul> <li>com.seeyon.v3x.dee.Document.Element</li> <li>Element是Document的元素</li> <li>一级元素为Document根元素,只有唯一一个,名称为“root”</li> <li>二级元素为“root”的子元素,定义为表名称,名称自定义但不允许重复,可以有多个</li> <li>三级元素为表元素的子元素,定义为表中行记录,名称固定为“row”,可以有多个</li> <li>四级元素为“row”的子元素,定义为字段,名称自定义但不允许重复,可以有多个,字段的值为数据值</li> </ul> <p><strong>格式如下:</strong></p> <pre><code> &amp;lt;root&amp;gt; &amp;lt;table1&amp;gt; &amp;lt;row&amp;gt; &amp;lt;field1&amp;gt;value&amp;lt;/field1&amp;gt;&amp;lt;field2&amp;gt;value&amp;lt;/field2&amp;gt;&amp;lt;fieldN&amp;gt;value&amp;lt;/fieldN&amp;gt;... &amp;lt;/row&amp;gt; &amp;lt;row&amp;gt; &amp;lt;field1&amp;gt;value&amp;lt;/field1&amp;gt;&amp;lt;field2&amp;gt;value&amp;lt;/field2&amp;gt;&amp;lt;fieldN&amp;gt;value&amp;lt;/fieldN&amp;gt;... &amp;lt;/row&amp;gt; ... &amp;lt;/table1&amp;gt; &amp;lt;table2&amp;gt; &amp;lt;row&amp;gt; &amp;lt;field1&amp;gt;value&amp;lt;/field1&amp;gt;&amp;lt;field2&amp;gt;value&amp;lt;/field2&amp;gt;&amp;lt;fieldN&amp;gt;value&amp;lt;/fieldN&amp;gt;... &amp;lt;/row&amp;gt; &amp;lt;row&amp;gt; &amp;lt;field1&amp;gt;value&amp;lt;/field1&amp;gt;&amp;lt;field2&amp;gt;value&amp;lt;/field2&amp;gt;&amp;lt;fieldN&amp;gt;value&amp;lt;/fieldN&amp;gt;... &amp;lt;/row&amp;gt; ... &amp;lt;/table2&amp;gt; ... &amp;lt;/root&amp;gt;</code></pre> <p><strong>方法列表:</strong></p> <table> <thead> <tr> <th>方法名称</th> <th>方法简介</th> </tr> </thead> <tbody> <tr> <td>String getName()</td> <td>获取当前元素的名称</td> </tr> <tr> <td>Object getValue()</td> <td>获取当前元素的值</td> </tr> <tr> <td>void setValue(Object value)</td> <td>设置当前元素的值</td> </tr> <tr> <td>List&lt;Element&gt; getChildren()</td> <td>获取当前元素的所有直接子元素</td> </tr> <tr> <td>List&lt;Element&gt; getChildren(String name)</td> <td>根据指定名称获取元素的直接子元素</td> </tr> <tr> <td>List&lt;Attribute&gt; getAttributes()</td> <td>获取当前元素的所有属性</td> </tr> <tr> <td>Attribute getAttribute(String name)</td> <td>根据指定名称获取当前元素的属性</td> </tr> <tr> <td>Attribute setAttribute(String name, Object value)</td> <td>设置当前元素的属性</td> </tr> <tr> <td>Element getChild(String name)</td> <td>根据名称获取当前元素的子元素</td> </tr> <tr> <td>Element addChild(String name)</td> <td>为当前元素增加指定名称的子元素</td> </tr> <tr> <td>Element addChild(Element element)</td> <td>为当前元素增加子元素</td> </tr> <tr> <td>void removeChild(String name)</td> <td>根据指定元素名称删除当前元素的子元素</td> </tr> </tbody> </table> <hr /> <p><strong>方法签名:</strong> </p> <p><code>String getName()</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>获取当前元素的名称</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">无</td> <td style="text-align: left;"></td> <td style="text-align: left;"></td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">String</td> <td style="text-align: left;">元素名称</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().getName();//可以获取root元素的名称</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>Object getValue();</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>获取当前元素的值</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">无</td> <td style="text-align: left;"></td> <td style="text-align: left;"></td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">Object</td> <td style="text-align: left;">元素的值</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>List&amp;lt;Element&amp;gt; list = document.getRootElement().getChild(&amp;quot;table1&amp;quot;).getChildren();//先获取table1的所有row元素 list.get(0).getChild(&amp;quot;field1&amp;quot;).getValue();//获取第一个row元素的子元素field1元素的值</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>void setValue(Object value)</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>设置当前元素的值</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">value</td> <td style="text-align: left;">Object</td> <td style="text-align: left;">元素的值</td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">void</td> <td style="text-align: left;">没有返回值</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>List&amp;lt;Element&amp;gt; list = document.getRootElement().getChild(&amp;quot;table1&amp;quot;).getChildren();//先获取table1的所有row元素 list.get(0).getChild(&amp;quot;field1&amp;quot;).setValue(&amp;quot;hello world&amp;quot;);//获取第一个row元素的子元素field1,并且设置field1元素的值为&amp;quot;hello world&amp;quot;</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>List&amp;lt;Element&amp;gt; getChildren()</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>获取当前元素的所有直接子元素</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">无</td> <td style="text-align: left;"></td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">List&lt;Element&gt;</td> <td style="text-align: left;">所有直接子节点Element对象的集合</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().getChildren();//可获取root节点下所有直接子节点(即表节点)</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>List&amp;lt;Element&amp;gt; getChildren(String name)</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>根据指定名称获取元素的直接子元素</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">name</td> <td style="text-align: left;">String</td> <td style="text-align: left;">子节点名称</td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">List&lt;Element&gt;</td> <td style="text-align: left;">所有名称为name的直接子节点Element对象的集合</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().getChild(&amp;quot;table1&amp;quot;).getChildren(&amp;quot;row&amp;quot;);//可获取表table1节点下的所有row节点的集合</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>List&amp;lt;Attribute&amp;gt; getAttributes()</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>获取当前元素的所有属性</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">无</td> <td style="text-align: left;"></td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">List&lt;Attribute&gt;</td> <td style="text-align: left;">元素所有属性的集合</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().getChild(&amp;quot;table1&amp;quot;).getAttributes();//获取表节点table1的所有属性</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>Attribute getAttribute(String name)</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>根据指定名称获取当前元素的属性</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">name</td> <td style="text-align: left;">String</td> <td style="text-align: left;">属性名称</td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">com.seeyon.v3x.dee.Document.Attribute</td> <td style="text-align: left;">元素属性对象</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().getChild(&amp;quot;table1&amp;quot;).getAttribute(&amp;quot;totalCount&amp;quot;);//获取表节点table1的“totalCount”属性</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>Attribute setAttribute(String name, Object value)</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>设置当前元素的属性</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">name</td> <td style="text-align: left;">String</td> <td style="text-align: left;">属性名称</td> </tr> <tr> <td style="text-align: left;">value</td> <td style="text-align: left;">Object</td> <td style="text-align: left;">属性值</td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">com.seeyon.v3x.dee.Document.Attribute</td> <td style="text-align: left;">设置到元素的属性对象</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().getChild(&amp;quot;table1&amp;quot;).setAttribute(&amp;quot;id&amp;quot;,&amp;quot;888&amp;quot;);//设置元素table1的属性id的值为“888”,如果元素table1没有属性“id”,那么会新建属性名称为“id”,值为“888”,并且设置给元素</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>Element getChild(String name)</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>根据名称获取当前元素的子元素</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">name</td> <td style="text-align: left;">String</td> <td style="text-align: left;">子元素名称</td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">com.seeyon.v3x.dee.Document.Element</td> <td style="text-align: left;">子元素对象</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().getChild(&amp;quot;table1&amp;quot;);//获取根元素下的名称为table1的表元素</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>Element addChild(String name)</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>为当前元素增加指定名称的子元素</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">name</td> <td style="text-align: left;">String</td> <td style="text-align: left;">子元素名称</td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">com.seeyon.v3x.dee.Document.Element</td> <td style="text-align: left;">子元素对象</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().addChild(&amp;quot;table2&amp;quot;);//增加根元素的子元素,名称为“table2”</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>Element addChild(Element element)</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>为当前元素增加子元素</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">element</td> <td style="text-align: left;">com.seeyon.v3x.dee.Document.Element</td> <td style="text-align: left;">子元素Element对象</td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">com.seeyon.v3x.dee.Document.Element</td> <td style="text-align: left;">子元素对象</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>Element table3 = document.createElement(&amp;quot;table3&amp;quot;);//创建名称为“table3”的元素 document.getRootElement().addChild(table3);//将“table3”元素插入根元素下,作为根元素的子元素</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul> <hr /> <p><strong>方法签名:</strong> </p> <p><code>void removeChild(String name)</code></p> <p><strong>简要描述:</strong> </p> <ul> <li>根据指定元素名称删除当前元素的子元素</li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">name</td> <td style="text-align: left;">String</td> <td style="text-align: left;">子元素名称</td> </tr> </tbody> </table> <p><strong>返回值说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">void</td> <td style="text-align: left;">没有返回值</td> </tr> </tbody> </table> <p><strong>使用例子</strong></p> <pre><code>document.getRootElement().removeChild(&amp;quot;table1&amp;quot;);//删除根元素下名称为“table1”的子元素</code></pre> <p><strong>备注</strong> </p> <ul> <li>无</li> </ul>

页面列表

ITEM_HTML