public class Reader extends AbstractReader
A Reader used to read EMF resources from a set of pathes.
A path can point to a folder or an archive (zips and jars are supported).
Those pathes are recursively scanned and all resources for which an IResourceServiceProvider is
registered in the IResourceServiceProvider.Registry will be available.
The ISetup of an Xtext language registers such an IResourceServiceProvider automatically. If you want to integrate with non Xtext-based models,
make sure to add IResourceServiceProvider manually. The easiest way might be to implement an ISetup.
A SlotEntry is responsible for selecting certain EObjects from the loaded resources.
It supports selecting EObjects by their name (see IEObjectDescription) or by an EClass.
In many cases such selction returns multiple EObjects, if you're only interested in one element set the firstOnly flag to true.
You might want to populate multiple workflow slots with model elements.
Below are examples of a usage in the MWE2 DSL and MWE XML syntax:
component = org.eclipse.xtext.mwe.Reader {
useJavaClassPath = true
register = foo.bar.MyLanguageStandaloneSetup {}
load = {
slot = "types"
type = "Type"
}
validate = org.eclipse.xtext.mwe.Validator { stopOnError = false }
}
<component class="org.eclipse.xtext.mwe.Reader" useJavaClassPath="true"> <register class="foo.bar.MyLanguageStandaloneSetup"/> <load slot="types" type="Type"/> <validate/> </component>It supports fetching elements by type
IResourceServiceProvider.getResourceDescriptionManager() is used to identify model elements within these resources.| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.log4j.Logger |
log |
protected java.util.List<java.lang.String> |
pathes |
| Constructor and Description |
|---|
Reader() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPath(java.lang.String path)
A comma-separated list of paths pointing to a folder, jar or zip which contains EMF resources.
|
protected void |
checkConfigurationInternal(org.eclipse.emf.mwe.core.issues.Issues issues) |
ContainersStateFactory |
getContainersStateFactory() |
java.util.List<java.lang.String> |
getPathes() |
protected PathTraverser |
getPathTraverser() |
UriFilter |
getUriFilter() |
protected void |
installAsAdapter(org.eclipse.emf.ecore.resource.ResourceSet set,
IAllContainersState containersState) |
protected void |
invokeInternal(org.eclipse.emf.mwe.core.WorkflowContext ctx,
org.eclipse.emf.mwe.core.monitor.ProgressMonitor monitor,
org.eclipse.emf.mwe.core.issues.Issues issues) |
protected void |
populateResourceSet(org.eclipse.emf.ecore.resource.ResourceSet set,
com.google.common.collect.Multimap<java.lang.String,org.eclipse.emf.common.util.URI> uris) |
void |
setContainersStateFactory(ContainersStateFactory containersStateFactory) |
void |
setUriFilter(UriFilter filter)
Optionally set a filter that specifies which URIs are valid to be read.
|
void |
setUseJavaClassPath(boolean isUse)
Automatically adds all class path entries of the current process (more specifically uses 'java.class.path' system property).
|
addLoad, addLoadFromResourceSet, addLoadResource, addModelElementsToContext, addRegister, getInjectors, getRegistry, getResourceDescriptionsProvider, getResourceSet, getResourceSetProvider, getSlotEntries, getValidator, setResourceDescriptionsProvider, setResourceSetProvider, setValidatecheckConfigurationprotected static final org.apache.log4j.Logger log
protected java.util.List<java.lang.String> pathes
public void addPath(java.lang.String path)
A comma-separated list of paths pointing to a folder, jar or zip which contains EMF resources.
Example use (MWE2):
path = "./foo/bar.jar,./src/main/model"
Example use (MWE1):
<path value="./foo/bar.jar,./src/main/model"/>
public java.util.List<java.lang.String> getPathes()
public void setUseJavaClassPath(boolean isUse)
Automatically adds all class path entries of the current process (more specifically uses 'java.class.path' system property).
Example use (MWE2):
useJavaClassPath = true
Example use (MWE1):
<useJavaClassPath value="true"/>
public void setUriFilter(UriFilter filter)
public UriFilter getUriFilter()
public void setContainersStateFactory(ContainersStateFactory containersStateFactory)
public ContainersStateFactory getContainersStateFactory()
protected void checkConfigurationInternal(org.eclipse.emf.mwe.core.issues.Issues issues)
checkConfigurationInternal in class AbstractReaderprotected void invokeInternal(org.eclipse.emf.mwe.core.WorkflowContext ctx,
org.eclipse.emf.mwe.core.monitor.ProgressMonitor monitor,
org.eclipse.emf.mwe.core.issues.Issues issues)
invokeInternal in class org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponentprotected PathTraverser getPathTraverser()
protected void populateResourceSet(org.eclipse.emf.ecore.resource.ResourceSet set,
com.google.common.collect.Multimap<java.lang.String,org.eclipse.emf.common.util.URI> uris)
protected void installAsAdapter(org.eclipse.emf.ecore.resource.ResourceSet set,
IAllContainersState containersState)
throws org.eclipse.emf.mwe.core.WorkflowInterruptedException
org.eclipse.emf.mwe.core.WorkflowInterruptedException