Package org.eclipse.emf.mwe.utils
Class StandaloneSetup
java.lang.Object
org.eclipse.emf.mwe.utils.StandaloneSetup
Initializes EMF support. Allows to register additional Packages.
Configuration
platformUri
Set the path to the root of the platform, usually ".."Explicit platform mapping
If no .project files are available, an explicit mapping of projectName to path may be established.projectMapping = { projectName = 'org.acme.myproject' path = '../org.acme.myproject' }
URI Mapping
Map one URI to another. This is for example required when some resource refers to another with platform:/plugin URIs. Platform plugin URIs cannot be resolved in standalone mode, thus these URIs must be mapped to file or platform resource URIs.uriMap = { from = "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore" to = "platform:/resource/myproject/model/Ecore.ecore" }
Bundle name mapping
In the case that the folder name of a project does not match the bundle name, maps the bundle name to the real directory name on the platform.bundleNameMap = { from = "my.bundle.name" to = "bundledirectoryname" }
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Pattern
protected org.eclipse.emf.ecore.EPackage.Registry
protected org.eclipse.emf.ecore.resource.ResourceSet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBundleNameMap
(Mapping mapping) void
Adds an extensionvoid
addProjectMapping
(ProjectMapping projectMapping) void
addRegisterEcoreFile
(String fileName) void
addRegisterGeneratedEPackage
(String interfacename) void
addRegisterGenModelFile
(String fileName) void
protected GenModelHelper
protected void
protected File
protected String
getBundleNameFromJarName
(String jarFileName) protected String
getBundleNameFromManifest
(JarFile jarFile) org.eclipse.emf.ecore.EPackage
getPackage
(String nsUri) static String
boolean
protected void
registerBundle
(File file) protected void
registerMapping
(String name, org.eclipse.emf.common.util.URI uri) protected void
registerProject
(File file) protected boolean
scanFolder
(File f) protected boolean
scanFolder
(File f, Set<String> visitedPathes) void
setIgnoreBrokenProjectFiles
(boolean ignoreBrokenProjectFiles) Allows to ignore exception that occur while reading.project
orManifest.MF
files.void
setLogResourceUriMap
(boolean doLog) void
setPlatformUri
(String pathToPlatform) sets the platform uri for standalone executionvoid
setResourceSet
(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) void
setResourceSetImpl
(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl resourceSet) void
setScanClassPath
(boolean doScan)
-
Field Details
-
JAR_NAME_PATTERN
-
resourceSet
protected org.eclipse.emf.ecore.resource.ResourceSet resourceSet -
registry
protected org.eclipse.emf.ecore.EPackage.Registry registry
-
-
Constructor Details
-
StandaloneSetup
public StandaloneSetup()
-
-
Method Details
-
getPlatformRootPath
-
setIgnoreBrokenProjectFiles
public void setIgnoreBrokenProjectFiles(boolean ignoreBrokenProjectFiles) Allows to ignore exception that occur while reading.project
orManifest.MF
files. Default isfalse
. -
isIgnoreBrokenProjectFiles
public boolean isIgnoreBrokenProjectFiles() -
setLogResourceUriMap
public void setLogResourceUriMap(boolean doLog) -
setScanClassPath
public void setScanClassPath(boolean doScan) -
doRegisterResourceMapping
-
findProjectFileForPossibleClassesFolder
-
setPlatformUri
sets the platform uri for standalone execution- Parameters:
pathToPlatform
-
-
addProjectMapping
-
scanFolder
-
scanFolder
-
registerBundle
-
getBundleNameFromManifest
- Throws:
IOException
-
getBundleNameFromJarName
-
registerMapping
-
registerProject
-
addUriMap
- Parameters:
uriMap
-
-
addExtensionMap
Adds an extension- Parameters:
m
- from: extension name, to factory classname- Throws:
ConfigurationException
-- The factory class for the extension cannot be found
- The inner factory class for the extension cannot be found
-
addRegisterGeneratedEPackage
-
setResourceSet
public void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) -
setResourceSetImpl
public void setResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl resourceSet) -
createGenModelHelper
-
addRegisterGenModelFile
-
addRegisterEcoreFile
public void addRegisterEcoreFile(String fileName) throws IllegalArgumentException, SecurityException -
getPackage
-
addBundleNameMap
-