bixstypeconverter.html
来自「ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.」· HTML 代码 · 共 312 行
HTML
312 行
<!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>BiXsTypeConverter</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="BiXsTypeConverter">BiXsTypeConverter</h1><p>This class contains static methods that converts XML Schema types to Javascript types as well as converting strings formatted according to the XML Schema to Javascript values.<br> <br> The following type relations are used<br> XS type name - JS type name - JS class "negativeInteger" - "number" - Number "unsignedShort" - "number" - Number "unsignedByte" - "number" - Number "unsignedLong" - "number" - Number "unsignedInt" - "number" - Number "decimal" - "number" - Number "boolean" - "number" - Number "integer" - "number" - Number "double" - "number" - Number "float" - "number" - Number "short" - "number" - Number "byte" - "number" - Number "long" - "number" - Number "int" - "number" - Number "QName" - "string" - String "string" - "string" - String "normalizedString" - "string" - String "dateTime" - "date" - Date "date" - "date" - Date "time" - "date" - Date</p><p>This class extends <code><a href="BiObject.html">BiObject</a></code> and therefore all methods and fields available for <code><a href="BiObject.html">BiObject</a></code> are also available for <code>BiXsTypeConverter</code>.</p><ul class="partial-class-tree"><li><code><a href="BiObject.html">BiObject</a></code><ul><li><code>BiXsTypeConverter</code><ul id="api-derived-classes"></ul></li></ul></li></ul><h2>Constructor</h2><p><code> new BiXsTypeConverter()</code></p><h3>Parameters</h3><p>No parameters.</p><h2>Properties</h2><p>None.</p><h2>Methods</h2><p>None.</p><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="#decodeIsoDate">decodeIsoDate</a></code></td><td>Takes a string formatted according to the XML Schema data type (this is the ISO standard format).</td></tr><tr><td><code><a href="#decodeIsoDateTime">decodeIsoDateTime</a></code></td><td>Takes a string formatted according to the XML Schema datatime type (this is the ISO standard format).<br> <br> Example: YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)</td></tr><tr><td><code><a href="#decodeIsoTime">decodeIsoTime</a></code></td><td>Takes a string formatted according to the XML Schema time type (this is the ISO standard format).</td></tr><tr><td><code><a href="#getJsType">getJsType</a></code></td><td>Takes the XML Schema type name and returns the Javacsript type (class, constructor). For example if you pass <code>"time"</code> you will get <code>Date</code> as the result.</td></tr><tr><td><code><a href="#getJsTypeName">getJsTypeName</a></code></td><td>Takes the XML Schema type name and returns the Javacsript type name. For example if you pass <code>"time"</code> you will get <code>"date"</code> as the result.</td></tr><tr><td><code><a href="#getJsValue">getJsValue</a></code></td><td>This takes a string and an XML schema type representing a value and then converts this string to the correct Javascript value.</td></tr></tbody></table><h2>Static Fields</h2><p>None.</p><h2>Remarks</h2><p> </p><h2>Static Method Details</h2><h3><a name="decodeIsoDate"></a>decodeIsoDate</h3><p>Takes a string formatted according to the XML Schema data type (this is the ISO standard format).</p><h4>Syntax</h4><pre class="method-syntax">BiXsTypeConverter.decodeIsoDate(<span class="methodArgument">s</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>s</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The string representing the ISO date.</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Data</code></p><h3><a name="decodeIsoDateTime"></a>decodeIsoDateTime</h3><p>Takes a string formatted according to the XML Schema datatime type (this is the ISO standard format).<br> <br> Example: YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)</p><h4>Syntax</h4><pre class="method-syntax">BiXsTypeConverter.decodeIsoDateTime(<span class="methodArgument">s</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>s</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The string representing the ISO date time.</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Date</code></p><h3><a name="decodeIsoTime"></a>decodeIsoTime</h3><p>Takes a string formatted according to the XML Schema time type (this is the ISO standard format).</p><h4>Syntax</h4><pre class="method-syntax">BiXsTypeConverter.decodeIsoTime(<span class="methodArgument">s</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>s</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The string representing the ISO date time.</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Date</code></p><h3><a name="getJsType"></a>getJsType</h3><p>Takes the XML Schema type name and returns the Javacsript type (class, constructor). For example if you pass <code>"time"</code> you will get <code>Date</code> as the result.</p><h4>Syntax</h4><pre class="method-syntax">BiXsTypeConverter.getJsType(<span class="methodArgument">sXsType</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>sXsType</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The XML Schema type name</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Function</code></p><h3><a name="getJsTypeName"></a>getJsTypeName</h3><p>Takes the XML Schema type name and returns the Javacsript type name. For example if you pass <code>"time"</code> you will get <code>"date"</code> as the result.</p><h4>Syntax</h4><pre class="method-syntax">BiXsTypeConverter.getJsTypeName(<span class="methodArgument">sXsType</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>sXsType</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The XML Schema type name</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">String</code></p><h3><a name="getJsValue"></a>getJsValue</h3><p>This takes a string and an XML schema type representing a value and then converts this string to the correct Javascript value.</p><h4>Syntax</h4><pre class="method-syntax">BiXsTypeConverter.getJsValue(<span class="methodArgument">sValue</span>, <span class="methodArgument">sXsType</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>sValue</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>A string describing the value expressed using the correct syntax according to the schema</td></tr><tr><td><code>sXsType</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The XML schema type name</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Object</code></p></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?