Klasse EObjectCrawler

java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.emf.cdo.common.util.EObjectCrawler
Alle implementierten Schnittstellen:
org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.event.INotifier.INotifier2, org.eclipse.net4j.util.lifecycle.IDeactivateable, org.eclipse.net4j.util.lifecycle.ILifecycle, org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation

public final class EObjectCrawler extends org.eclipse.net4j.util.lifecycle.Lifecycle
A crawler for arbitrary EObjects that creates CDORevisions on the fly and feeds them to a CDORevisionCrawler.

The EObjectCrawler.ModelScope inner class allows to register EObjects and then create an EObjectCrawler for the registered objects.

Example usage:

 MessageDigest digest = MessageDigest.getInstance("SHA-1");
 Handler handler = new CDORevisionCrawler.MessageDigestHandler(digest);

 ModelScope scope = new ModelScope();
 scope.registerObject(EcorePackage.eINSTANCE, true);

 EObjectCrawler crawler = scope.createCrawler().handler(handler);
 crawler.begin();
 crawler.addObject(EcorePackage.Literals.EOBJECT);
 crawler.finish();

 System.out.println(HexUtil.bytesToHex(digest.digest()));
 
The example above registers the EcorePackage and all its contents in a model scope, creates an EObjectCrawler for the scope, sets a handler that computes a SHA-1 message digest, begins the crawling session, adds the EObject class (which causes it to be crawled according to the default feature strategy), and finally finishes the crawling session.

At this point, the digest contains the SHA-1 message digest of the binary representation of all the CDORevisions that were crawled.

Seit:
4.27
Autor:
Eike Stepper