org.eclipse.incquery.runtime.base.comprehension

## Class EMFVisitor

- java.lang.Object
- - org.eclipse.incquery.runtime.base.comprehension.EMFVisitor

- Direct Known Subclasses:
    NavigationHelperVisitor

      public class EMFVisitor
      extends java.lang.Object

  Use EMFModelComprehension to visit an EMF model.
  Author:
    Bergmann Gábor

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EMFVisitor(boolean preOrder)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `preOrder()`
    `boolean` | `pruneFeature(org.eclipse.emf.ecore.EStructuralFeature feature)` Returns true if the given feature should not be traversed (interesting esp.
    `boolean` | `pruneSubtrees(org.eclipse.emf.ecore.EObject source)` Returns true if the contents of an object should be pruned (and not explored by the visitor)
    `boolean` | `pruneSubtrees(org.eclipse.emf.ecore.resource.Resource source)` Returns true if the contents of a resource should be pruned (and not explored by the visitor)
    `void` | `visitAttribute(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EAttribute feature, java.lang.Object target)`
    `void` | `visitElement(org.eclipse.emf.ecore.EObject source)`
    `void` | `visitInternalContainment(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EReference feature, org.eclipse.emf.ecore.EObject target)`
    `void` | `visitNonContainmentReference(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EReference feature, org.eclipse.emf.ecore.EObject target)`
    `void` | `visitProxyReference(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject targetObject, java.lang.Integer position)` Called after visiting the reference, if the target is a proxy.
    `void` | `visitResource(org.eclipse.emf.ecore.resource.Resource resource)`
    `void` | `visitTopElementInResource(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.EObject element)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EMFVisitor

          public EMFVisitor(boolean preOrder)

  - ### Method Detail

    - #### visitTopElementInResource

          public void visitTopElementInResource(org.eclipse.emf.ecore.resource.Resource resource,
                                                org.eclipse.emf.ecore.EObject element)

      Parameters:
        `resource` -
        `element` -

    - #### visitResource

          public void visitResource(org.eclipse.emf.ecore.resource.Resource resource)

      Parameters:
        `resource` -

    - #### visitElement

          public void visitElement(org.eclipse.emf.ecore.EObject source)

      Parameters:
        `source` -

    - #### visitNonContainmentReference

          public void visitNonContainmentReference(org.eclipse.emf.ecore.EObject source,
                                                   org.eclipse.emf.ecore.EReference feature,
                                                   org.eclipse.emf.ecore.EObject target)

      Parameters:
        `source` -
        `feature` -
        `target` -

    - #### visitInternalContainment

          public void visitInternalContainment(org.eclipse.emf.ecore.EObject source,
                                               org.eclipse.emf.ecore.EReference feature,
                                               org.eclipse.emf.ecore.EObject target)

      Parameters:
        `source` -
        `feature` -
        `target` -

    - #### visitAttribute

          public void visitAttribute(org.eclipse.emf.ecore.EObject source,
                                     org.eclipse.emf.ecore.EAttribute feature,
                                     java.lang.Object target)

      Parameters:
        `source` -
        `feature` -
        `target` -

    - #### pruneFeature

          public boolean pruneFeature(org.eclipse.emf.ecore.EStructuralFeature feature)

      Returns true if the given feature should not be traversed (interesting esp. if multi-valued)

    - #### pruneSubtrees

          public boolean pruneSubtrees(org.eclipse.emf.ecore.EObject source)

      Returns true if the contents of an object should be pruned (and not explored by the visitor)

    - #### pruneSubtrees

          public boolean pruneSubtrees(org.eclipse.emf.ecore.resource.Resource source)

      Returns true if the contents of a resource should be pruned (and not explored by the visitor)

    - #### preOrder

          public boolean preOrder()

      Returns:
        if objects should be visited before their outgoing edges

    - #### visitProxyReference

          public void visitProxyReference(org.eclipse.emf.ecore.EObject source,
                                          org.eclipse.emf.ecore.EReference reference,
                                          org.eclipse.emf.ecore.EObject targetObject,
                                          java.lang.Integer position)

      Called after visiting the reference, if the target is a proxy.
      Parameters:
        `position` - optional: known position in multivalued collection (for more efficient proxy resolution)