Example: Creating custom Java tools for Epsilon

* Copyright (c) 2008 The University of York.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
* SPDX-License-Identifier: EPL-2.0
package org.eclipse.epsilon.examples.tools;

import org.eclipse.epsilon.eol.execute.context.Variable;
import org.eclipse.epsilon.eol.tools.AbstractTool;

public class SampleTool extends AbstractTool {
  protected String name;
  public void setName(String name) {
    this.name = name;
  public String getName() {
    return name;
  public String sayHello() {
    return "Hello " + name;
  // Creates a new variable called variableName
  // and adds it to the frame stack
  public void sayHelloAsVariable(String variableName) {
      createReadOnlyVariable(variableName, sayHello()));
var sampleTool = new Native("org.eclipse.epsilon.examples.tools.SampleTool");
sampleTool.name = "George";

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>

source.. = src/
output.. = bin/
bin.includes = META-INF/,\

Clone Epsilon's Git repository and then:

Once you have checked out/imported the code, to run the example you need to go through the following steps:

  1. register any .ecore metamodels in the org.eclipse.epsilon.examples.tools project
  2. right click the .launch file in the org.eclipse.epsilon.examples.tools project
  3. select Run as... and click the first item in the menu that pops up

What's this?

In this example, we create a custom tool for Epsilon.

What are .emf files?

.emf files are Ecore metamodels expressed using the Emfatic textual syntax.

More examples...

Epsilon Object Language
Epsilon Transformation Language
Epsilon Generation Language
Epsilon Validation Language
Epsilon Merging Language
Epsilon Flock
Epsilon Model Generation Language
Epsilon Pattern Language
Combining the Epsilon Languages

Even more examples...

More examples are available in the examples folder of the Git repository.