blob: 6c287eb50616d6fd5bba6cf2fdb135454cf08936 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<!--
/********************************************************************************
** Copyright (c) 2015 Obeo.
** All rights reserved. This program and the accompanying materials
** are made available under the terms of the Eclipse Public License v1.0
** which accompanies this distribution, and is available at
** http://www.eclipse.org/legal/epl-v10.html
**
** Contributors:
** Stephane Begaudeau (Obeo) - initial API and implementation
*********************************************************************************/
-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="St&eacute;phane B&eacute;gaudeau">
<!-- IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="../assets/css/bootstrap.css" rel="stylesheet">
<link href="../assets/css/docs.css" rel="stylesheet">
<title>Acceleo</title>
</head>
<body>
<div class="container">
<header class="jumbotron subhead" id="overview">
<h1>Acceleo Query Language Documentation</h1>
<!--<div class="subnav">
<ul class="nav nav-pills">
<li><a href="#introduction">Introduction</a></li>
<li><a href="#language">Language</a></li>
<li><a href="#operations">Operations</a></li>
<li><a href="#standalone">Stand Alone</a></li>
<li><a href="#migration">Migration</a></li>
<li><a href="#textproductionrules">Text Production Rules</a></li>
<li><a href="#onlineresources">Online Resources</a></li>
</ul>
</div>-->
</header>
<section id="services">
<div class="page-header">
<h1>Services available for all types</h1>
</div>
<h3>add(self: java.lang.String, any: java.lang.Object) = String</h3>
<p>
Returns the concatenation of the current string and the given object "any" (as a String).
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>'times '.add(42)</td>
<td>'times 42'</td>
</tr>
</tbody>
</table>
<p>
</p>
<hr />
<h3>add(self: java.lang.Object, s: java.lang.String) = String</h3>
<p>
Returns the concatenation of self (as a String) and the given string "s".
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>42.add(' times')</td>
<td>'42 times'</td>
</tr>
</tbody>
</table>
<p>
</p>
<hr />
<h3>differs(o1: java.lang.Object, o2: java.lang.Object) = Boolean</h3>
<p>
Indicates whether the object "o1" is a different object from the object "o2".
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>'Hello'.differs('World')</td>
<td>true</td>
</tr>
<tr>
<td>'Hello'.differs('Hello')</td>
<td>false</td>
</tr>
</tbody>
</table>
<p>
</p>
<hr />
<h3>equals(o1: java.lang.Object, o2: java.lang.Object) = Boolean</h3>
<p>
Indicates whether the object "o1" i"the same as the object "o2". For more information refer to the Object#equals(Object) method.
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>'Hello'.equals('World')</td>
<td>false</td>
</tr>
<tr>
<td>'Hello'.equals('Hello')</td>
<td>true</td>
</tr>
</tbody>
</table>
<p>
</p>
<hr />
<h3>oclAsType(object: java.lang.Object, type: java.lang.Object) = Object</h3>
<p>
Casts the current object to the given type.
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>anEPackage.oclAsType(ecore::EPackage)</td>
<td>anEPackage</td>
</tr>
<tr>
<td>anEPackage.oclAsType(ecore::EClass)</td>
<td>anEPackage</td>
</tr>
</tbody>
</table>
<p>
Contrary to Acceleo 3, the type is ignored, the given object will be returned directly.
</p>
<h4>In other languages</h4>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Language</th>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>Acceleo 3 (MTL)</td>
<td>anEPackage.oclAsType(ecore::EPackage)</td>
<td>anEPackage</td>
</tr>
<tr>
<td>Acceleo 3 (MTL)</td>
<td>anEPackage.oclAsType(ecore::EClass)</td>
<td>oclInvalid</td>
</tr>
</tbody>
</table>
<hr />
<h3>oclIsKindOf(object: java.lang.Object, type: java.lang.Object) = Boolean</h3>
<p>
Evaluates to "true" if the type of the object o1 conforms to the type "classifier". That is, o1 is of type "classifier" or a subtype of "classifier".
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>anEPackage.oclIsKindOf(ecore::EPackage)</td>
<td>true</td>
</tr>
<tr>
<td>anEPackage.oclIsKindOf(ecore::ENamedElement)</td>
<td>true</td>
</tr>
</tbody>
</table>
<p>
</p>
<hr />
<h3>oclIsTypeOf(object: java.lang.Object, type: java.lang.Object) = Boolean</h3>
<p>
Evaluates to "true" if the object o1 if of the type "classifier" but not a subtype of the "classifier".
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>anEPackage.oclIsTypeOf(ecore::EPackage)</td>
<td>true</td>
</tr>
<tr>
<td>anEPackage.oclIsTypeOf(ecore::ENamedElement)</td>
<td>false</td>
</tr>
</tbody>
</table>
<p>
</p>
<hr />
<h3>toString(self: java.lang.Object) = String</h3>
<p>
Returns a string representation of the current object.
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>42.toString()</td>
<td>'42'</td>
</tr>
</tbody>
</table>
<p>
</p>
<hr />
<h3>trace(self: java.lang.Object) = String</h3>
<p>
Returns a string representation of the current environment.
</p>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Expression</th>
<th>Result</th>
</tr>
</thead><colgroup><col width="60%" /><col width="40%" /></colgroup>
<tbody>
<tr>
<td>42.trace()</td>
<td>'Metamodels:
http://www.eclipse.org/emf/2002/Ecore
Services:
org.eclipse.acceleo.query.services.AnyServices
public java.lang.String org.eclipse.acceleo.query.services.AnyServices.add(java.lang.Object,java.lang.String)
...
receiver: 42
'</td>
</tr>
</tbody>
</table>
<p>
</p>
<hr />
</section>
</div>
</body>
</html>