ProtoBuf.Reflect.Element.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: Element</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Class: Element</h1>
  17. <section>
  18. <header>
  19. <h2>
  20. <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
  21. Element
  22. </h2>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h4 class="name" id="Element"><span class="type-signature"></span>new Element<span class="signature">(type, resolvedType, isMapKey, syntax, name)</span><span class="type-signature"></span></h4>
  27. <div class="description">
  28. <p>Constructs a new Element implementation that checks and converts values for a
  29. particular field type, as appropriate.</p>
  30. <p>An Element represents a single value: either the value of a singular field,
  31. or a value contained in one entry of a repeated field or map field. This
  32. class does not implement these higher-level concepts; it only encapsulates
  33. the low-level typechecking and conversion.</p>
  34. </div>
  35. <h5>Parameters:</h5>
  36. <table class="params">
  37. <thead>
  38. <tr>
  39. <th>Name</th>
  40. <th>Type</th>
  41. <th class="last">Description</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <tr>
  46. <td class="name"><code>type</code></td>
  47. <td class="type">
  48. <span class="param-type">Object</span>
  49. </td>
  50. <td class="description last"><p>Resolved data type</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>resolvedType</code></td>
  54. <td class="type">
  55. <span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
  56. |
  57. <span class="param-type">null</span>
  58. </td>
  59. <td class="description last"><p>Resolved type, if relevant
  60. (e.g. submessage field).</p></td>
  61. </tr>
  62. <tr>
  63. <td class="name"><code>isMapKey</code></td>
  64. <td class="type">
  65. <span class="param-type">boolean</span>
  66. </td>
  67. <td class="description last"><p>Is this element a Map key? The value will be
  68. converted to string form if so.</p></td>
  69. </tr>
  70. <tr>
  71. <td class="name"><code>syntax</code></td>
  72. <td class="type">
  73. <span class="param-type">string</span>
  74. </td>
  75. <td class="description last"><p>Syntax level of defining message type, e.g.,
  76. proto2 or proto3.</p></td>
  77. </tr>
  78. <tr>
  79. <td class="name"><code>name</code></td>
  80. <td class="type">
  81. <span class="param-type">string</span>
  82. </td>
  83. <td class="description last"><p>Name of the field containing this element (for error
  84. messages)</p></td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-source">Source:</dt>
  90. <dd class="tag-source"><ul class="dummy"><li>
  91. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1720">line 1720</a>
  92. </li></ul></dd>
  93. </dl>
  94. </div>
  95. <h3 class="subsection-title">Members</h3>
  96. <h4 class="name" id="isMapKey"><span class="type-signature"></span>isMapKey<span class="type-signature"> :boolean</span></h4>
  97. <div class="description">
  98. <p>Element is a map key.</p>
  99. </div>
  100. <h5>Type:</h5>
  101. <ul>
  102. <li>
  103. <span class="param-type">boolean</span>
  104. </li>
  105. </ul>
  106. <dl class="details">
  107. <dt class="tag-source">Source:</dt>
  108. <dd class="tag-source"><ul class="dummy"><li>
  109. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1738">line 1738</a>
  110. </li></ul></dd>
  111. </dl>
  112. <h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
  113. <div class="description">
  114. <p>Name of the field containing this element (for error messages)</p>
  115. </div>
  116. <h5>Type:</h5>
  117. <ul>
  118. <li>
  119. <span class="param-type">string</span>
  120. </li>
  121. </ul>
  122. <dl class="details">
  123. <dt class="tag-source">Source:</dt>
  124. <dd class="tag-source"><ul class="dummy"><li>
  125. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1750">line 1750</a>
  126. </li></ul></dd>
  127. </dl>
  128. <h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
  129. <div class="description">
  130. <p>Element type reference to submessage or enum definition, if needed.</p>
  131. </div>
  132. <h5>Type:</h5>
  133. <ul>
  134. <li>
  135. <span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
  136. |
  137. <span class="param-type">null</span>
  138. </li>
  139. </ul>
  140. <dl class="details">
  141. <dt class="tag-source">Source:</dt>
  142. <dd class="tag-source"><ul class="dummy"><li>
  143. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1732">line 1732</a>
  144. </li></ul></dd>
  145. </dl>
  146. <h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
  147. <div class="description">
  148. <p>Syntax level of defining message type, e.g., proto2 or proto3.</p>
  149. </div>
  150. <h5>Type:</h5>
  151. <ul>
  152. <li>
  153. <span class="param-type">string</span>
  154. </li>
  155. </ul>
  156. <dl class="details">
  157. <dt class="tag-source">Source:</dt>
  158. <dd class="tag-source"><ul class="dummy"><li>
  159. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1744">line 1744</a>
  160. </li></ul></dd>
  161. </dl>
  162. <h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :Object</span></h4>
  163. <div class="description">
  164. <p>Element type, as a string (e.g., int32).</p>
  165. </div>
  166. <h5>Type:</h5>
  167. <ul>
  168. <li>
  169. <span class="param-type">Object</span>
  170. </li>
  171. </ul>
  172. <dl class="details">
  173. <dt class="tag-source">Source:</dt>
  174. <dd class="tag-source"><ul class="dummy"><li>
  175. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1726">line 1726</a>
  176. </li></ul></dd>
  177. </dl>
  178. <h3 class="subsection-title">Methods</h3>
  179. <h4 class="name" id=".defaultFieldValue"><span class="type-signature">(static) </span>defaultFieldValue<span class="signature">(type)</span><span class="type-signature"> &rarr; {*}</span></h4>
  180. <div class="description">
  181. <p>Returns the default value for this field in proto3.</p>
  182. </div>
  183. <h5>Parameters:</h5>
  184. <table class="params">
  185. <thead>
  186. <tr>
  187. <th>Name</th>
  188. <th>Type</th>
  189. <th class="last">Description</th>
  190. </tr>
  191. </thead>
  192. <tbody>
  193. <tr>
  194. <td class="name"><code>type</code></td>
  195. <td class="type">
  196. <span class="param-type">string</span>
  197. |
  198. <span class="param-type">Object</span>
  199. </td>
  200. <td class="description last"><p>the field type</p></td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. <dl class="details">
  205. <dt class="tag-source">Source:</dt>
  206. <dd class="tag-source"><ul class="dummy"><li>
  207. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1780">line 1780</a>
  208. </li></ul></dd>
  209. </dl>
  210. <h5>Returns:</h5>
  211. <div class="param-desc">
  212. <p>Default value</p>
  213. </div>
  214. <dl>
  215. <dt>
  216. Type
  217. </dt>
  218. <dd>
  219. <span class="param-type">*</span>
  220. </dd>
  221. </dl>
  222. </article>
  223. </section>
  224. </div>
  225. <nav>
  226. <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
  227. </nav>
  228. <br class="clear">
  229. <footer>
  230. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
  231. </footer>
  232. <script> prettyPrint(); </script>
  233. <script src="scripts/linenumber.js"> </script>
  234. </body>
  235. </html>