⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bixmlresourceparser.html

📁 在流览器上仿CS界面的JAVASCRIPT脚本
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--
Generated using api.website.xsl version 2003-07-17
-->
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>BiXmlResourceParser</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript">

				function showDerivedClasses() {
					var ul = document.getElementById("api-derived-classes");
					var lis = ul.childNodes;
					var l = lis.length;
					for (var i = 1; i < l; i++)
						lis[i].style.display = "";
					lis[0].style.display = "none";
				}

			</script></head>
<body>
<h1 id="BiXmlResourceParser">BiXmlResourceParser</h1>
<p>
		This class deserializes an XML document to a Bindows object hierarchy.
		This is mostly tailored for <code><a href="BiComponent.html">BiComponent</a></code>
		hierarchies but can be used for any class extending <code><a href="BiObject.html">BiObject</a></code>.
	</p>
<p>This class extends
		<code><a href="BiXmlLoader.html">BiXmlLoader</a></code>
		and therefore all methods and fields available for
		<code><a href="BiXmlLoader.html">BiXmlLoader</a></code>
		are also available for <code>BiXmlResourceParser</code>.</p>
<ul class="partial-class-tree">
<li><code><a href="BiObject.html">BiObject</a></code><ul>
<li><code><a href="BiEventTarget.html">BiEventTarget</a></code><ul><li><code><a href="BiTextLoader.html">BiTextLoader</a></code><ul><li><code><a href="BiXmlLoader.html">BiXmlLoader</a></code><ul><li><code>BiXmlResourceParser</code><ul id="api-derived-classes"></ul></li></ul></li></ul></li></ul></li></ul>
</li>
</ul>
<h2>Constructor</h2>
<p><code>

	new BiXmlResourceParser()</code></p>
<h3>Parameters</h3>
<p>No parameters.</p>
<h2>Properties</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="get-header">get</td>
<td class="set-header">set</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><a name="rootNode"></a><code>rootNode</code></td>
<td><code class="type">XML Node</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>
				The XML element that describes the root of the object hierarchy.
				Only set this before you actually use the parser.
			</td>
</tr>
</tbody>
</table>
<h2>Methods</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="#fromNode">fromNode</a></code></td>
<td>
				Takes an XML element and returns a BiObject (or a derivative).
				The tag name is used as the class name and for each attribute,
				<code><a href="BiObject.html#setAttribute">setAttribute</a></code>
				is called on the object. For each child node (unless it declares
				a complex property)
				<code><a href="BiObject.html#addXmlNode">addXmlNode</a></code> is
				called on the object.
			</td>
</tr>
<tr>
<td><code><a href="#getComponentById">getComponentById</a></code></td>
<td>
				Returns the component (BiObject) with the given
				<code><a href="BiObject.html#id">id</a></code> property. If the
				parser has not yet encountered an element with this id attribute
				it will look forward in the document and if an element is found
				with the given id it will be deserialized and the object will
				be returned.
			</td>
</tr>
</tbody>
</table>
<h2>Events</h2>
<p>None.</p>
<h2>Static Methods</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="#getClassFromDocument">getClassFromDocument</a></code></td>
<td>
				Creates a constructor that uses the XML document as its base. This
				constructor can then be used to create instances of this class or
				used to create sub classes.
			</td>
</tr>
<tr>
<td><code><a href="#getClassFromNode">getClassFromNode</a></code></td>
<td>
				Creates a constructor that uses the XML element as its base. This
				constructor can then be used to create instances of this class or
				used to create sub classes.
			</td>
</tr>
<tr>
<td><code><a href="#getClassFromUri">getClassFromUri</a></code></td>
<td>
				Loads an XML document from the URI and then creates a constructor
				that can then be used to create instances of that class. See the
				remarks below.
			</td>
</tr>
</tbody>
</table>
<h2>Static Fields</h2>
<p>None.</p>
<h2>Remarks</h2>
<p>
		When creating a class from a node or URI the class will extend the class
		that the root element is of. The class will have a property getter called
		<code>xmlResourceParser</code> that returns the resource loader and a method
		called <code>getComponentById</code> that allows lookup of objects from
		the XML resource.
	</p>
<h2>Method Details</h2>
<h3><a name="fromNode"></a>fromNode</h3>
<p>
				Takes an XML element and returns a BiObject (or a derivative).
				The tag name is used as the class name and for each attribute,
				<code><a href="BiObject.html#setAttribute">setAttribute</a></code>
				is called on the object. For each child node (unless it declares
				a complex property)
				<code><a href="BiObject.html#addXmlNode">addXmlNode</a></code> is
				called on the object.
			</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.fromNode(<span class="methodArgument">oNode</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>oNode</code></td>
<td><code class="type"></code></td>
<td class="optional-column"></td>
<td></td>
<td>
						The XML node to create an object for.
					</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">Function</code></p>
<h3><a name="getComponentById"></a>getComponentById</h3>
<p>
				Returns the component (BiObject) with the given
				<code><a href="BiObject.html#id">id</a></code> property. If the
				parser has not yet encountered an element with this id attribute
				it will look forward in the document and if an element is found
				with the given id it will be deserialized and the object will
				be returned.
			</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getComponentById(<span class="methodArgument">sId</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sId</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>
						The id of the object to find
					</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type"><code><a href="BiObject.html">BiObject</a></code></code></p>
<h2>Static Method Details</h2>
<h3><a name="getClassFromDocument"></a>getClassFromDocument</h3>
<p>
				Creates a constructor that uses the XML document as its base. This
				constructor can then be used to create instances of this class or
				used to create sub classes.
			</p>
<h4>Syntax</h4>
<pre class="method-syntax">BiXmlResourceParser.getClassFromDocument(<span class="methodArgument">oDoc</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>oDoc</code></td>
<td><code class="type"><code><a href="BiXmlDocument.html">BiXmlDocument</a></code></code></td>
<td class="optional-column"></td>
<td></td>
<td>
						The XML document used to describe the object hierarchy.
					</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">Function</code></p>
<h3><a name="getClassFromNode"></a>getClassFromNode</h3>
<p>
				Creates a constructor that uses the XML element as its base. This
				constructor can then be used to create instances of this class or
				used to create sub classes.
			</p>
<h4>Syntax</h4>
<pre class="method-syntax">BiXmlResourceParser.getClassFromNode(<span class="methodArgument">oNode</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>oNode</code></td>
<td><code class="type">XML Node</code></td>
<td class="optional-column"></td>
<td></td>
<td>
						The XML node used to describe the object hierarchy.
					</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">Function</code></p>
<h3><a name="getClassFromUri"></a>getClassFromUri</h3>
<p>
				Loads an XML document from the URI and then creates a constructor
				that can then be used to create instances of that class. See the
				remarks below.
			</p>
<h4>Syntax</h4>
<pre class="method-syntax">BiXmlResourceParser.getClassFromUri(<span class="methodArgument">oUri</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>oUri</code></td>
<td><code class="type">String/<code><a href="BiUri.html">BiUri</a></code></code></td>
<td class="optional-column"></td>
<td></td>
<td>
						The location of the file. If this is a string a
						new URI is created from that string relative to the
						<code><a href="BiApplication.html#adfPath">ADF path</a></code>.
					</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">Function</code></p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -