bixmlresourceparser.xml

来自「ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.」· XML 代码 · 共 204 行

XML
204
字号
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="api.xsl"?><class name="BiXmlResourceParser" extends="BiXmlLoader">	<description>This class deserializes an XML document to a Bindows object hierarchy. This is mostly tailored for <link class="BiComponent">BiComponent</link> hierarchies but can be used for any class extending <link class="BiObject">BiObject</link>.</description>	<arguments>	</arguments>	<staticMethods>		<method name="getClassFromUri">			<description>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.</description>			<arguments>				<argument name="oUri">					<description>The location of the file. If this is a string a 							new URI is created from that string relative to the                          <link class="BiApplication" field="adfPath">ADF path</link>.</description>					<type>Biuri</type>				</argument>			</arguments>			<returns>				<type>Function</type>			</returns>		</method>		<method name="getClassFromDocument">			<description>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.</description>			<arguments>				<argument name="oDoc">					<description>The XML document used to describe the object hierarchy.</description>					<type>						<link class="BiXmlDocument">BiXmlDocument</link>					</type>				</argument>			</arguments>			<returns>				<type>Function</type>			</returns>		</method>		<method name="getClassFromNode">			<description>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.</description>			<arguments>				<argument name="oNode">					<description>The XML node used to describe the object hierarchy.</description>					<type>Node</type>				</argument>			</arguments>			<returns>				<type>Function</type>			</returns>		</method>	</staticMethods>	<staticFields>	</staticFields>	<methods>		<method name="fromNode">			<description>Takes an XML element and returns a<link class="BiObject">BiObject</link> (or a derivative). The tag name is used as the class name and for each attribute, <link field="setAttribute" class="BiObject">setAttribute</link> is called on the object. For each child node (unless it declares a complex property) <link field="addXmlNode" class="BiObject">addXmlNode</link> is called on the object.</description>			<arguments>				<argument name="oNode">					<description>The XML node to create an object for.</description>					<type>Node</type>				</argument>			</arguments>			<returns>				<type>Object</type>			</returns>		</method>		<method name="processAttributes">			<description>This takes an object and an XML element and then goes through the attributes and calls <link class="BiObject" field="setAttribute">setAttribute</link> on the object.<br>				</br>				<br>				</br> This is also where attached properties are handled. See the remarks.</description>			<arguments>				<argument name="o">					<description>The object to map the attributes onto</description>					<type>						<link class="BiObject">BiObject</link>					</type>				</argument>				<argument name="oNode">					<description>The XML element that provides the attributes</description>					<type>Node</type>				</argument>			</arguments>			<returns>				<type>void</type>			</returns>		</method>		<method name="processChildNodes">			<description>This takes an object and an XML element and then goes through all the child nodes of the XML element and calls <link class="BiObject" field="addXmlNode">addXmlNode</link> on the object.<br>				</br>				<br>				</br> This is also where complex properties are handled. See the remarks.</description>			<arguments>				<argument name="obj">					<description>The object to map the children onto</description>					<type>						<link class="BiObject">BiObject</link>					</type>				</argument>				<argument name="oNode">					<description>The XML element that provides the child nodes</description>					<type>Node</type>				</argument>			</arguments>			<returns>				<type>void</type>			</returns>		</method>		<method name="getComponentById">			<description>Returns the component (BiObject) with the given <link field="id" class="BiObject">id</link> 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.</description>			<arguments>				<argument name="sId">					<description>The id of the object to find</description>					<type>String</type>				</argument>			</arguments>			<returns>				<type>					<link class="BiObject">BiObject</link>				</type>			</returns>		</method>	</methods>	<properties>		<property name="autoNameMapping" get="true" set="true">			<description>When this is true any XML object that has an id attribute will create a global reference (with the same name as the id value) to the object created from this XML element.</description>			<type>Boolean</type>		</property>		<property name="rootNode" get="true" set="true">			<description>The XML element that describes the root of the object hierarchy. Only set this before you actually use the parser.</description>			<type>Node</type>		</property>	</properties>	<events>	</events>	<remarks>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. Classes created in this way will call a method called          <code>initialize</code> from the constructor using the same arguments          that were passed to the constructor<br>		</br>		<br>		</br> 			Complex properties are represented using child elements with a tag name 			matching the class name of the current element followed by a '.' and 			then the property name.<br>		</br>		<br>		</br> 			&lt;Component&gt;<br>		</br> 			   &lt;Component.border&gt;<br>		</br> 			      &lt;Border color="red"/&gt;<br>		</br> 			   &lt;/Component.border&gt;<br>		</br> 			&lt;/Component&gt;<br>		</br>		<br>		</br>          Attached properties are a special kind of properties that follow          an interface with the following format:<br>		</br>		<br>		</br>          ClassName.setProperty( oSource, sValue )<br>		</br>		<br>		</br>          This is represented using the following XML code:<br>		</br>		<br>		</br>          &lt;Component ClassName.property="value"/&gt;</remarks></class>

⌨️ 快捷键说明

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