Package com._1c.g5.v8.dt.core.findref
Class AbstractBmReferencesCollectorVisitorCallback
- java.lang.Object
-
- com._1c.g5.v8.dt.core.findref.AbstractBmReferencesCollectorVisitorCallback
-
- All Implemented Interfaces:
IEObjectVisitorCallback
public abstract class AbstractBmReferencesCollectorVisitorCallback extends Object implements IEObjectVisitorCallback
The abstractIEObjectVisitorCallback
implementation.
It collects BM object cross references and processes it. Successors should implementprocessReferences(IBmObject, Collection)
method to provide processing feature. The example below iterates over cross references and prints it to console.{@code IEObjectVisitorCallback callback = new AbstractBmReferencesCollectorVisitorCallback(bmModel, dependentModels) {
-
-
Constructor Summary
Constructors Constructor Description AbstractBmReferencesCollectorVisitorCallback(IBmModel bmModel, Collection<IBmModel> dependentModels)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
checkReference(IBmModel bmModel, IBmCrossReference reference)
Checks theIBmCrossReference
during collecting, before processing.protected IBmModel
getBmModel()
Returns the BM model.protected Collection<IBmModel>
getDependentModels()
Returns a collection of dependent BM models.protected boolean
isBmObject(org.eclipse.emf.ecore.EObject object)
Checks if the specified object is BM object.void
postVisit(org.eclipse.emf.ecore.EObject eObject)
Post visit is invoked after theIEObjectVisitorCallback.visit(EObject)
foreObject
and its subordinate object is invoked.protected abstract void
processReferences(IBmObject bmObject, Collection<BmModelCrossReference> references)
Process the references for the specifiedbmObject
.void
visit(org.eclipse.emf.ecore.EObject eObject)
Visits the specifiedeObject
.
-
-
-
Constructor Detail
-
AbstractBmReferencesCollectorVisitorCallback
public AbstractBmReferencesCollectorVisitorCallback(IBmModel bmModel, Collection<IBmModel> dependentModels)
Creates a new instance.- Parameters:
bmModel
- theIBmModel
, cannot benull
.dependentModels
- the collection of dependent models, cannot benull
.
-
-
Method Detail
-
visit
public void visit(org.eclipse.emf.ecore.EObject eObject)
Description copied from interface:IEObjectVisitorCallback
Visits the specifiedeObject
.- Specified by:
visit
in interfaceIEObjectVisitorCallback
- Parameters:
eObject
- theEObject
instance, cannot benull
.
-
postVisit
public void postVisit(org.eclipse.emf.ecore.EObject eObject)
Description copied from interface:IEObjectVisitorCallback
Post visit is invoked after theIEObjectVisitorCallback.visit(EObject)
foreObject
and its subordinate object is invoked.- Specified by:
postVisit
in interfaceIEObjectVisitorCallback
- Parameters:
eObject
- theEObject
instance, cannot benull
.
-
getBmModel
protected final IBmModel getBmModel()
Returns the BM model.- Returns:
- the BM model, never
null
.
-
getDependentModels
protected final Collection<IBmModel> getDependentModels()
Returns a collection of dependent BM models.- Returns:
- a collection of dependent BM models, never
null
.
-
isBmObject
protected final boolean isBmObject(org.eclipse.emf.ecore.EObject object)
Checks if the specified object is BM object. It means that object is instance ofIBmObject
and its engine is notnull
.- Parameters:
object
- the object to check, cannot benull
.- Returns:
true
if the specified object is BM object,false
- otherwise.
-
checkReference
protected boolean checkReference(IBmModel bmModel, IBmCrossReference reference)
Checks theIBmCrossReference
during collecting, before processing. By default it does nothing.- Parameters:
bmModel
- the BM model, cannot benull
.reference
- the reference to check, cannot benull
.- Returns:
true
if the references is checked and should be processed,false
- otherwise.
-
processReferences
protected abstract void processReferences(IBmObject bmObject, Collection<BmModelCrossReference> references)
Process the references for the specifiedbmObject
.- Parameters:
bmObject
- the BM object, cannot benull
.references
- the references, cannot benull
.
-
-