Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse EMF Validation Framework
Previous Page Home Next Page

EMF Model Validation Model Traversal Strategies



Extension point on which plug-ins can contribute customized logic for traversal of EMF metamodels that they define, in batch validation.

Configuration Markup:

<!ELEMENT extension ( traversalStrategy+)>

<!ATTLIST extension





<!ELEMENT traversalStrategy ( eclass*)>

<!ATTLIST traversalStrategy

namespaceUri CDATA #REQUIRED

class        CDATA #REQUIRED


Declares a traversal strategy that knows how to iterate sub-trees rooted at elements of types in a specific EPackage. Zero or more EClasses may be specified to indicate which specific element types are to use the traversal strategy. If no EClasses are listed, then this strategy constitutes the default for the package. Multiple traversal strategies can be provided for the same EPackage, for example to iterate different element types in different ways. In fact, at at least two declarations are needed to define a default strategy for the package and a select number of alternative implementations for specific EClasses.

  • namespaceUri - The namespace URI of the EPackage for which the extension declares a traversal strategy.
  • class - The fully-qualified name of a class implementing the ITraversalStrategy interface.


<!ATTLIST eclass



Indicates a specific EClass in the package identified by the extension's namespace URI to which the traversal strategy applies. This EClass is assumed to be one whose instances can serve as a root container, thus defining a "kind of" model implemented by the metamodel. A metamodel may require different traversal algorithms for resources rooted in different metaclasses; the validation system finds the most appropriate traversal strategy for an element according to its root container. The inheritance of EClasses is taken into account. During validation, the system finds the most specific strategy declaration available for any EClass (defaulting to the package default strategy if needed). As an example of metamodels that distinguish different kinds of models by the root container type, the UML 2.0 metamodel defines Model and Profile metaclasses (both specializations of Package) that can serve as root containers.

  • name - The name of an EClass in the EPackage.


This example shows an extension that declares a traversal strategy for the EXTLibrary meta-model. It applies to traversals starting at Persons or Items (rather than at libraries), perhaps because its purpose is to back-track to the nearest containing Library and start from there. When traversal starts from a Library, this extension indicates that the default strategy (recursion over the containment tree) is sufficient.


         <eclass name=
         <eclass name=

Copyright (c) 2005 IBM Corporation and others.
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

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire