| <!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.1</title> |
| </head> |
| <body class="otdt"> |
| <div id="content"> |
| <table class="nav"> |
| <tr> |
| <td class="back"><a id="top"></a><a href="s2.1.2.b.html" rel="prev"><< §2.1.2.(b) Cycles</a></td> |
| <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| <td class="next"><a href="s2.1.2.d.html" rel="next">§2.1.2.(d) Base imports >></a></td> |
| </tr> |
| </table> |
| <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">§2 Role Binding</a> > <a class="nav" href="s2.1.html" rel="section">§2.1 playedBy relation</a> > <a class="nav" href="s2.1.2.html" rel="section">§2.1.2 Legal base classes</a></div> |
| <div class="subsect depth4" id="s2.1.2.c"> |
| <h4 class="subsect">§2.1.2.(c) <span class="title">Base class decapsulation</span><a class="img" href="s2.1.2.c.html" |
| title="PermaLink to (c) Base class decapsulation"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| alt="" /></a></h4> |
| <p>If a base class referenced after <code>playedBy</code> exists but is not visible under normal visibility rules of Java, |
| this restriction may be overridden. This concept is called <strong>decapsulation</strong>, i.e., the opposite of encapsulation |
| (see also <a href="s3.4.html" title="§3.4 Overriding access restrictions" |
| class="sect">§3.4</a>). A compiler should signal any occurrence of base class decapsulation. If a compiler supports to |
| configure warnings this may be used to let the user choose to (a) ignore base class decapsulation, (b) treat it as a warning |
| or even |
| (c) treat it as an error. |
| |
| </p> |
| <p> |
| Binding to a <code>final</code> base class is also considered as decapsulation, since a <code>playedBy</code> relationship has |
| powers similar to an <code>extends</code> relationship, which is prohibited by marking a class as <code>final</code>. |
| |
| </p> |
| <p> |
| Decapsulation is not allowed if the base class is a confined role (see <a href="s7.2.html" title="§7.2 Confined roles" class="sect">§7.2</a>). |
| |
| </p> |
| <p> |
| Within the current role a decapsulated base class can be mentioned in the right-hand-side of any method binding |
| (<a href="s3.html" title="§3 Callout Binding" class="sect">callout (§3)</a> or <a href="s4.html" title="§4 Callin Binding" class="sect">callin (§4)</a>). Also arguments in these positions are allowed to mention the decapsulated base class: |
| |
| </p> |
| <ul> |
| <li>the first argument of one of the role's constructors (see <a href="s2.4.1.html" |
| title="§2.4.1 Role creation via a lifting constructor" |
| class="sect">lifting constructor (§2.4.1)</a>). |
| </li> |
| <li>the base side of an argument with declared lifting (see <a href="s2.3.2.html" title="§2.3.2 Declared lifting" class="sect">declared lifting (§2.3.2)</a>). |
| </li> |
| </ul> |
| </div> |
| <table class="nav"> |
| <tr> |
| <td class="back"><a href="s2.1.2.b.html" rel="prev"><< §2.1.2.(b) Cycles</a></td> |
| <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| <td class="next"><a href="s2.1.2.d.html" rel="next">§2.1.2.(d) Base imports >></a></td> |
| </tr> |
| </table> |
| <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">§2 Role Binding</a> > <a class="nav" href="s2.1.html" rel="section">§2.1 playedBy relation</a> > <a class="nav" href="s2.1.2.html" rel="section">§2.1.2 Legal base classes</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.1 — last modified: 2013-05-28 |
| </div> |
| </body> |
| </html> |