Package com._1c.g5.v8.dt.core.model
Class EObjectVisitor
- java.lang.Object
-
- com._1c.g5.v8.dt.core.model.EObjectVisitor
-
public class EObjectVisitor extends Object
TheEObject
visitor.
It walks through theEObject
.EObject eObject = ...; IEObjectVisitorCallback callback = ...; EObjectVisitor visitor = new EObjectVisitor(callback); visitor.visit(eObject);
For the specifiedeObject
visit(EObject)
performs the next steps:- It delegates visiting to the callback:
IEObjectVisitorCallback.visit(EObject)
; - collects subordinate objects and recursively invokes 'visit' operation;
- delegates post visiting to the callback:
IEObjectVisitorCallback.postVisit(EObject)
Subordinate objects are the children of the given one determined not only physically but logically (determined by business rules). Subordinate objects are collected byISubordinateObjectsCollector.collectSubordinateObjects(EObject)
. If there are no collectors provided subordinate objects it will be automatically collected. It collects all containment references of the specified object in automatical way. - It delegates visiting to the callback:
-
-
Constructor Summary
Constructors Constructor Description EObjectVisitor(IEObjectVisitorCallback callback)
Creates a new visitor instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<org.eclipse.emf.ecore.EObject>
getSubordinateObjects(org.eclipse.emf.ecore.EObject eObject)
Returns the subordinate objects of the specifiedeObject
.protected IEObjectVisitorCallback
getVisitorCallback()
Returns the visitor instance.void
visit(org.eclipse.emf.ecore.EObject eObject)
Traverses the specifiedeObject
recursively.
-
-
-
Constructor Detail
-
EObjectVisitor
public EObjectVisitor(IEObjectVisitorCallback callback)
Creates a new visitor instance.- Parameters:
callback
- theIEObjectVisitorCallback
instance, cannot benull
.
-
-
Method Detail
-
visit
public void visit(org.eclipse.emf.ecore.EObject eObject)
Traverses the specifiedeObject
recursively.- Parameters:
eObject
- the object to travers, cannot benull
.
-
getSubordinateObjects
protected Collection<org.eclipse.emf.ecore.EObject> getSubordinateObjects(org.eclipse.emf.ecore.EObject eObject)
Returns the subordinate objects of the specifiedeObject
.- Parameters:
eObject
- the object, cannot benull
.- Returns:
- a collection of subordinate objects, never
null
.
-
getVisitorCallback
protected final IEObjectVisitorCallback getVisitorCallback()
Returns the visitor instance.- Returns:
- the visitor instance, never
null
.
-
-