Difference between revisions of "Database"

From Event-B
Jump to navigationJump to search
imported>Mathieu
m (a small bit of info...)
imported>Jastram
 
(9 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
The common interface for all dtabase elements is {{class|IRodinElement}}.
 
The common interface for all dtabase elements is {{class|IRodinElement}}.
  
 +
== IRodinDB ==
 +
Getting the Rodin Database
 +
 +
import org.rodinp.core.RodinCore;
 +
import org.rodinp.core.IRodinDB;
 +
...
 +
IRodinDB rodinDB = RodinCore.getRodinDB();
 +
 +
== IRodinProject ==
 +
From Rodin database to get Rodin project(s)
 +
* Get the list of Rodin projects in the Rodin database.
 +
 +
IRodinProject [] rodinProjects = rodinDB.getRodinProjects();
 +
 +
* Get a Rodin project by name
 +
 +
IRodinProject rodinProject = rodinDB.getRodinProject(name);
 +
 +
== IRodinFile ==
 +
From the Rodin project to get Rodin file(s)
 +
* Get the list of Rodin files in a Rodin project
 +
 +
IRodinFile[] getRodinFiles() throws RodinDBException;
 +
 +
* Get a Rodin file by name
 +
 +
IRodinFile getRodinFile(String fileName);
 +
 +
== IInternalElement ==
 +
* Get the root element corresponding to a Rodin file.
 +
 +
IInternalElement rootElement = rodinFile.getRoot();
 +
 +
 +
== IEventBProject ==
 +
Getting an Event-B Project from a Rodin Project.
 +
 +
IEventBProject eventBProject = rodinProject.getAdapter(IEventBProject.class);
  
  
Line 13: Line 51:
  
 
=== IMachineRoot ===
 
=== IMachineRoot ===
 +
* Get a machine root by name
 +
IMachineRoot machineRoot = eventBProject.getMachineRoot(name);
  
  
 
[[Category:Developer documentation]]
 
[[Category:Developer documentation]]
 
[[Category:Rodin Platform]]
 
[[Category:Rodin Platform]]

Latest revision as of 07:55, 3 September 2009

This page described the rodin database API. TODO: by someone knowing the internals of rodin. Describe the database API

The database API is located in the

org.rodinp.core

in the

org.rodinp.core

plug-in.

The common interface for all dtabase elements is IRodinElement.

IRodinDB

Getting the Rodin Database

import org.rodinp.core.RodinCore;
import org.rodinp.core.IRodinDB;
...
IRodinDB rodinDB = RodinCore.getRodinDB();

IRodinProject

From Rodin database to get Rodin project(s)

  • Get the list of Rodin projects in the Rodin database.
IRodinProject [] rodinProjects = rodinDB.getRodinProjects();
  • Get a Rodin project by name
IRodinProject rodinProject = rodinDB.getRodinProject(name);

IRodinFile

From the Rodin project to get Rodin file(s)

  • Get the list of Rodin files in a Rodin project
IRodinFile[] getRodinFiles() throws RodinDBException;
  • Get a Rodin file by name
IRodinFile getRodinFile(String fileName);

IInternalElement

  • Get the root element corresponding to a Rodin file.
IInternalElement rootElement = rodinFile.getRoot();


IEventBProject

Getting an Event-B Project from a Rodin Project.

IEventBProject eventBProject = rodinProject.getAdapter(IEventBProject.class);


IRodinElement

IMachineRoot

  • Get a machine root by name
IMachineRoot machineRoot = eventBProject.getMachineRoot(name);