Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

ReqCycle / developer resources / Reachable

Reachable

org.polarsys.reqcycle.uri.model.Reachable is an equivalent to java.net.URI which represents the URI of any object accessible in ReqCycle.

Reachable definition is contained within org.polarsys.reqcycle.uri plugin.

When ReqCycle is aware of objects transformable to Reachable modifications it can notify listeners of this modification. To listen these notifications clients shall use org.polarsys.reqcycle.uri.IReachableListenerManager service

ReachableObject

Get a reachable Object

org.polarsys.reqcycle.uri.model.ReachableObject is an interface offering services to reachables.

Using ReqCycle services it is possible :

  • from a javaobject to get a ReachableObject then a Reachable
  • from a Reachable to get a ReachableObject

Service able to get Reachable Object from either a Reachable or a java Object is org.polarsys.reqcycle.uri.IReachableManager

for example this is classical code to get a Reachable from a java object (manager is an instance of IReachableManager)

→ manager.getHandlerFromObject(element).getFromObject(element).getReachable();

each call is not nullable so it is possible to not verify if result is NULL

Reachable Object Services

Services available from a ReachableObject :

IVisitable getVisitable() throws VisitableException;

  • returns an instance of of org.polarsys.reqcycle.uri.visitors.IVisitable accepting visitors to this reachable. For example if the reachable represents a file, it shall accept a visitor (org.polarsys.reqcycle.uri.visitors.IVisitor) which will visit its content

String getRevisionIdentification();

  • returns a revision of this reachable. This information can be used to determine if the object behind the reachable has changed. If the information is impossible to determine. NULL can be returned

Reachable getReachable();

  • returns the Reachable
    • note : Reachable r = manager.getHandlerFromReachable(reachable).getFromReachable(reachable).getReachable();
    • → r shall be equals to reachable

EMF Objects

EMF Objects (or org.eclipse.emf.ecore.EObject) can be automatically transformed to Reachables. The current condition is that the file extension of the resource of the given EObject is referenced through the extension point (org.eclipse.emf.ecore plugin) :

<extension point="org.eclipse.emf.ecore.extension_parser">

   <parser type="fileExtension" class="org.example.abc.util.AbcResourceFactoryImpl"/>

</extension>

Adapters

ReachableObject extends org.eclipse.core.runtime.IAdaptable and can be adapted to several types.

Common adapted types in ReqCycle are :

  • org.eclipse.core.resources.IMarker : for locating objects
  • org.eclipse.core.resources.IFile or org.eclipse.core.resources.IResource : for getting platform resource object
  • org.eclipse.jface.viewers.ILabelProvider : to display label information from a reachable (different than the URI)
  • org.polarsys.reqcycle.uri.model.IBusinessModel : currently to determine if the object exist or not

Back to the top