Class AbstractModelInferrer
- java.lang.Object
-
- org.eclipse.xtext.xbase.jvmmodel.AbstractModelInferrer
-
- All Implemented Interfaces:
IJvmModelInferrer
public abstract class AbstractModelInferrer extends java.lang.Object implements IJvmModelInferrer
A base dispatch class to be subclassed by clients. It allows subclasses to use Xtend's dispatch methods in order to avoid explicit tree navigation and instanceof checking. see alsoIJvmModelInferrer
- Since:
- 2.7
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer
IJvmModelInferrer.NullImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected JvmAnnotationReferenceBuilder
_annotationTypesBuilder
protected JvmTypeReferenceBuilder
_typeReferenceBuilder
-
Constructor Summary
Constructors Constructor Description AbstractModelInferrer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
_infer(org.eclipse.emf.ecore.EObject e, IJvmDeclaredTypeAcceptor acceptor, boolean preIndexingPhase)
void
infer(org.eclipse.emf.ecore.EObject e, IJvmDeclaredTypeAcceptor acceptor, boolean preIndexingPhase)
This method is called at two different times in a resource's life-cycle, reflected by whether {preIndexingPhase} is set totrue
orfalse
.
-
-
-
Field Detail
-
_annotationTypesBuilder
@Extension protected JvmAnnotationReferenceBuilder _annotationTypesBuilder
-
_typeReferenceBuilder
@Extension protected JvmTypeReferenceBuilder _typeReferenceBuilder
-
-
Method Detail
-
infer
public void infer(org.eclipse.emf.ecore.EObject e, IJvmDeclaredTypeAcceptor acceptor, boolean preIndexingPhase)
Description copied from interface:IJvmModelInferrer
This method is called at two different times in a resource's life-cycle, reflected by whether {preIndexingPhase} is set to
true
orfalse
. When set totrue
everything is still in a pre-indexing phase, that means linking hasn't been done yet. In this phase you just need to create the Jvm-elements which should be indexed (i.e. found globally). For regular Xbase expressions only the JvmTypes with the correct qualified name are needed at this point.You must only infer Jvm elements which directly result from elements contained in the current resource!
When this method is called with preIndexingPhase set to
false
, you need to do the full inference including setting all links. But still you have to it in a particular order. First you need to create the complete tree structure and make sure you have passed the created JvmTypes to the acceptor. Only pass top levelJvmType
s to the acceptor. Only if the tree structure is created and its root types have been passed to the acceptor, you are free to resolve any cross references.- Specified by:
infer
in interfaceIJvmModelInferrer
- Parameters:
e
- the root element from the parse resultacceptor
- an acceptor awaiting derived rootJvmDeclaredType
spreIndexingPhase
- whether the call is done in before indexing. During this phase clients may not rely on any global indexing information and only need to provide the information needed by the language'sIDefaultResourceDescriptionStrategy
. IF not implemented differently this is just theJvmDeclaredType
s with their qualified name, but no members and no other data.
-
_infer
public void _infer(org.eclipse.emf.ecore.EObject e, IJvmDeclaredTypeAcceptor acceptor, boolean preIndexingPhase)
-
-