Class CompoundMetamodelProviderService
- java.lang.Object
-
- org.eclipse.viatra.query.patternlanguage.emf.scoping.CompoundMetamodelProviderService
-
- All Implemented Interfaces:
IMetamodelProvider
public class CompoundMetamodelProviderService extends java.lang.Object implements IMetamodelProvider
A new, delegating metamodel provider that can handle multiple differentIMetamodelProviderInstanceimplementations, and sorts them based on priority.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description CompoundMetamodelProviderService(java.util.Set<IMetamodelProviderInstance> providers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.xtext.scoping.IScopegetAllMetamodelObjects(org.eclipse.xtext.scoping.IScope delegateScope, org.eclipse.emf.ecore.EObject context)Returns a set of all available EPackages wrapped intoIEObjectDescriptionfor the use of scoping.java.lang.StringgetModelPluginId(org.eclipse.emf.ecore.EPackage ePackage, org.eclipse.emf.ecore.resource.ResourceSet set)Returns the identifier of the plugin that contains the generated model code.java.lang.StringgetQualifiedClassName(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EObject context)booleanisGeneratedCodeAvailable(org.eclipse.emf.ecore.EPackage ePackage, org.eclipse.emf.ecore.resource.ResourceSet set)Returns true if the generated code is available for the given EPackage, the code uses the given resource set as context.org.eclipse.emf.ecore.EPackageloadEPackage(java.lang.String uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)Loads an EMF package from the nsURI or resource URI of the model, and uses the resource set given as the second parameter.
-
-
-
Constructor Detail
-
CompoundMetamodelProviderService
@Inject public CompoundMetamodelProviderService(java.util.Set<IMetamodelProviderInstance> providers)
-
-
Method Detail
-
getAllMetamodelObjects
public org.eclipse.xtext.scoping.IScope getAllMetamodelObjects(org.eclipse.xtext.scoping.IScope delegateScope, org.eclipse.emf.ecore.EObject context)Description copied from interface:IMetamodelProviderReturns a set of all available EPackages wrapped intoIEObjectDescriptionfor the use of scoping. It uses theIEObjectDescriptions from the delegate scope provider too, this way theEPackages from the XText index will be available too.- Specified by:
getAllMetamodelObjectsin interfaceIMetamodelProvider- Parameters:
delegateScope- the delegate scopecontext- the context object for the scoping
-
loadEPackage
public org.eclipse.emf.ecore.EPackage loadEPackage(java.lang.String uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)Description copied from interface:IMetamodelProviderLoads an EMF package from the nsURI or resource URI of the model, and uses the resource set given as the second parameter.- Specified by:
loadEPackagein interfaceIMetamodelProvider- Returns:
- the loaded EMF EPackage
-
isGeneratedCodeAvailable
public boolean isGeneratedCodeAvailable(org.eclipse.emf.ecore.EPackage ePackage, org.eclipse.emf.ecore.resource.ResourceSet set)Description copied from interface:IMetamodelProviderReturns true if the generated code is available for the given EPackage, the code uses the given resource set as context.- Specified by:
isGeneratedCodeAvailablein interfaceIMetamodelProvider- Parameters:
ePackage- for which the availability of generated code is checkedset- used for context in the checking- Returns:
- true, if the generated code for the EPackage is available
-
getModelPluginId
public java.lang.String getModelPluginId(org.eclipse.emf.ecore.EPackage ePackage, org.eclipse.emf.ecore.resource.ResourceSet set)Description copied from interface:IMetamodelProviderReturns the identifier of the plugin that contains the generated model code.- Specified by:
getModelPluginIdin interfaceIMetamodelProvider- Parameters:
ePackage- for which the model plugin ID is requestedset- used for context in the searching- Returns:
- the model plugin ID or null if it cannot be found
- Since:
- 1.5
-
getQualifiedClassName
public java.lang.String getQualifiedClassName(org.eclipse.emf.ecore.EClassifier classifier, org.eclipse.emf.ecore.EObject context)- Specified by:
getQualifiedClassNamein interfaceIMetamodelProvider
-
-