| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| <link rel="stylesheet" type="text/css" href="../css/ot.css" /> |
| <link rel="stylesheet" type="text/css" href="../css/otjld.css" /> |
| <title>OT/J Language Definition v1.3</title> |
| </head> |
| <body class="otdt"> |
| <div id="content"> |
| <table class="nav"> |
| <tr> |
| <td class="back"><a id="top"></a><a href="sA.2.html" rel="prev"><< §A.2 Modifiers</a></td> |
| <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| <td class="next"><a href="sA.4.html" rel="next">§A.4 Parameter mappings >></a></td> |
| </tr> |
| </table> |
| <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">§A OT/J Syntax</a></div> |
| <div class="sect depth2" id="sA.3"> |
| <h2 class="sect">§A.3 Method bindings<a class="img" href="sA.3.html" |
| title="PermaLink to §A.3 Method bindings"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| alt="" /></a></h2> |
| <p>The rule of items declarable in a class body is augmented by method |
| bindings: |
| |
| </p> |
| <table class="syntaxrule" id="sA.3.1"> |
| <tr> |
| <td class="sect">§ A.3.1</td> |
| <td class="rule"><span class="title">ClassBodyDeclaration</span><br />... <br /><strong class="blue"><em>CalloutBinding</em></strong><br /><strong class="blue"><em>CallinBinding</em></strong></td> |
| </tr> |
| </table> |
| <table class="syntaxrule" id="sA.3.2"> |
| <tr> |
| <td class="sect">§ A.3.2</td> |
| <td class="rule"><span class="title">CalloutBinding</span><br /><em>[Modifier] [TypeArguments] <strong class="blue">MethodSpec CalloutKind MethodSpec CalloutParameterMappings</strong></em><br /><em>[Modifier] [TypeArguments] <strong class="blue">MethodSpec CalloutKind CalloutModifier FieldSpec</strong></em></td> |
| </tr> |
| </table> |
| <table class="syntaxrule" id="sA.3.3"> |
| <tr> |
| <td class="sect">§ A.3.3</td> |
| <td class="rule"><span class="title">Callin binding</span><br /><em>[ Identifier </em>:<em> ] [TypeArguments]</em><strong class="blue"><em> MethodSpec</em> <- <em>CallinModifier MethodSpecs </em><br /><span class="indent5"></span> |
| [<em>Guard</em>]<em> CallinParameterMappings</em></strong></td> |
| </tr> |
| </table> |
| <table class="syntaxrule" id="sA.3.4"> |
| <tr> |
| <td class="sect">§ A.3.4</td> |
| <td class="rule"><span class="title">MethodSpec</span><br /><em>Identifier</em><br /><em>ResultType MethodDeclarator</em></td> |
| </tr> |
| </table> |
| <div class="note"> |
| Note, that <em>ResultType</em> and <em>MethodDeclarator</em> are not explicit in the |
| overall syntax of the Java language specification. For convenience we refer to the definition in |
| section <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40420" |
| class="ext">8.4. Method Declarations</a> |
| of the Java language specification. |
| |
| </div> |
| <table class="syntaxrule" id="sA.3.5"> |
| <tr> |
| <td class="sect">§ A.3.5</td> |
| <td class="rule"><span class="title">MethodSpecs</span><br /><strong class="blue"><em>MethodSpec [</em>, <em>MethodSpecs]</em></strong></td> |
| </tr> |
| </table> |
| <table class="syntaxrule" id="sA.3.6"> |
| <tr> |
| <td class="sect">§ A.3.6</td> |
| <td class="rule"><span class="title">CalloutKind</span><br /><strong class="blue">-><br />=></strong></td> |
| </tr> |
| </table> |
| <table class="syntaxrule" id="sA.3.7"> |
| <tr> |
| <td class="sect">§ A.3.7</td> |
| <td class="rule"><span class="title">CallinModifier</span><br /><strong class="blue">before</strong><br /><strong class="blue">after</strong><br /><strong class="blue">replace</strong></td> |
| </tr> |
| </table> |
| <table class="syntaxrule" id="sA.3.8"> |
| <tr> |
| <td class="sect">§ A.3.8</td> |
| <td class="rule"><span class="title">CalloutModifier</span><br /><strong class="blue">get</strong><br /><strong class="blue">set</strong></td> |
| </tr> |
| </table> |
| <table class="syntaxrule" id="sA.3.9"> |
| <tr> |
| <td class="sect">§ A.3.9</td> |
| <td class="rule"><span class="title">FieldSpec</span><br /><em>[Type] Identifier</em></td> |
| </tr> |
| </table> |
| <div class="constraints"> |
| <h5 class="constraints">Contextual constraints:</h5> |
| <ol class="constraints"> |
| <li><code>CalloutBinding</code>s and <code>CallinBinding</code>s |
| may occur only in bound role classes. |
| </li> |
| <li>A <code>CalloutBinding</code> or <code>CallinBinding</code> |
| may not mix identifiers and full signatures (<code>MethodDeclarationHead</code>) |
| for its method specifiers (<code>MethodSpec</code>). |
| <br /> |
| Binding a full method signature to a field requires the <code>FieldSpec</code> |
| to include the <code>Type</code>. |
| </li> |
| <li>The method specifier at the left hand side of a |
| <code>CallinBinding</code> which has the <code>replace</code> modifier |
| must refer to a method that has the <code>callin</code> modifier. |
| </li> |
| <li>The <code>Modifier</code> of a callout binding can only be one of the visility |
| modifiers <code>public</code>, <code>protected</code> or <code>private</code>. |
| A short callout binding (i.e., without signatures) must not specify |
| a visibility modifier. |
| </li> |
| </ol> |
| </div> |
| </div> |
| <table class="nav"> |
| <tr> |
| <td class="back"><a href="sA.2.html" rel="prev"><< §A.2 Modifiers</a></td> |
| <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| <td class="next"><a href="sA.4.html" rel="next">§A.4 Parameter mappings >></a></td> |
| </tr> |
| </table> |
| <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">§A OT/J Syntax</a></div> |
| </div> |
| <div id="footer"> |
| <hr /><a class="w3c img" href="http://jigsaw.w3.org/css-validator/check/referer" |
| shape="rect"><img src="../images/valid-css2-blue.png" alt="Valid CSS!" height="31" width="88" /></a><a class="w3c img" href="http://validator.w3.org/check?uri=referer" shape="rect"><img src="../images/valid-xhtml10-blue.png" alt="Valid XHTML 1.0 Strict" height="31" |
| width="88" /></a><address>© Stephan Herrmann, Christine Hundt, Marco Mosconi</address> |
| OT/J version 1.3 — last modified: 2011-03-10 |
| </div> |
| </body> |
| </html> |