|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmt.weaver.plugin.util.WeaverResourceUtil
public class WeaverResourceUtil
This class contains convenient static methods for managing resource
Constructor Summary | |
---|---|
WeaverResourceUtil()
|
Method Summary | |
---|---|
static java.io.InputStream |
addListOfStreams(java.util.List inputStreams)
returns a unique stream starting from a list of stream |
static java.io.InputStream |
addStream(java.io.InputStream stream1,
java.io.InputStream stream2)
Adds stream1 and stream2 and return stream result |
static java.lang.String |
getFullPath(java.lang.String fileStr)
returns the full path of a file, given its relative path |
static int |
getModelFormat(java.lang.String filename)
Returns the format (extension) of model file |
static org.eclipse.emf.ecore.resource.ResourceSet |
initializeResourceSet(java.util.List resourceSets,
org.eclipse.emf.common.util.URI uri)
Initializes a resource using a uri The uri corresponds to the to the reference ou the ressource in the resource set |
static org.eclipse.emf.ecore.resource.ResourceSet |
initializeResourceSet(org.eclipse.emf.ecore.resource.ResourceSet rsMM,
org.eclipse.emf.ecore.resource.Resource resIfNul,
java.lang.String file,
org.eclipse.emf.common.util.URI uri)
Initializes a resource with a file The uri corresponds to the to the reference ou the ressource in the resource set |
static org.eclipse.emf.ecore.resource.ResourceSet |
initializeResourceSet(java.lang.String file,
org.eclipse.emf.common.util.URI uri)
Initializes a resource with a file The uri corresponds to the to the reference ou the ressource in the resource set |
static org.eclipse.emf.ecore.resource.Resource |
initResource(org.eclipse.emf.ecore.resource.Resource resource)
registers the package in the package registry and associates the instance class name for every primitive type |
static org.eclipse.emf.ecore.resource.Resource |
km3Stream2EcoreResource(java.io.InputStream km3Stream,
java.lang.String ecoreFile)
Returns an associated xmi resource based on a KM3 file (make transformation) |
static java.util.List |
loadKm3ExtensionStreamList(java.util.List extensionFiles,
java.util.List localExtensionFiles)
Returns a List of InputStream with all km3 files extension |
static void |
refreshResourceFolder(org.eclipse.emf.ecore.resource.Resource res)
Refreshes the folder of the resource. |
static org.eclipse.emf.ecore.resource.Resource |
registerResource(org.eclipse.emf.ecore.resource.Resource resource)
registers the package in the package registry |
static void |
validateWeavingMetamodelSemantic(org.eclipse.emf.ecore.resource.Resource weavingMetaModel)
Validate semantic of weaving metamodel if error found, throw an exception |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WeaverResourceUtil()
Method Detail |
---|
public static java.lang.String getFullPath(java.lang.String fileStr)
fileStr
-
public static org.eclipse.emf.ecore.resource.Resource registerResource(org.eclipse.emf.ecore.resource.Resource resource)
resource
- public static org.eclipse.emf.ecore.resource.Resource initResource(org.eclipse.emf.ecore.resource.Resource resource)
resource
- public static org.eclipse.emf.ecore.resource.ResourceSet initializeResourceSet(java.lang.String file, org.eclipse.emf.common.util.URI uri) throws java.io.IOException, WeaverException
file
- uri
-
java.io.IOException
WeaverException
public static org.eclipse.emf.ecore.resource.ResourceSet initializeResourceSet(org.eclipse.emf.ecore.resource.ResourceSet rsMM, org.eclipse.emf.ecore.resource.Resource resIfNul, java.lang.String file, org.eclipse.emf.common.util.URI uri) throws java.io.IOException, WeaverException
rsMM
- the resource set of the metamodelfile
- uri
-
java.io.IOException
WeaverException
public static org.eclipse.emf.ecore.resource.ResourceSet initializeResourceSet(java.util.List resourceSets, org.eclipse.emf.common.util.URI uri) throws java.io.IOException, WeaverException
uri
-
java.io.IOException
WeaverException
public static int getModelFormat(java.lang.String filename)
filename
-
public static java.io.InputStream addStream(java.io.InputStream stream1, java.io.InputStream stream2)
stream1
- stream2
-
public static java.io.InputStream addListOfStreams(java.util.List inputStreams) throws WeaverException
inputStreams
-
WeaverException
WeaverException
public static org.eclipse.emf.ecore.resource.Resource km3Stream2EcoreResource(java.io.InputStream km3Stream, java.lang.String ecoreFile) throws WeaverException
km3Stream
- ecoreFile
-
WeaverException
public static java.util.List loadKm3ExtensionStreamList(java.util.List extensionFiles, java.util.List localExtensionFiles) throws WeaverException
extensionFiles
- the extensions of metamodel in the extension pluginlocalExtensionFiles
-
WeaverException
public static void validateWeavingMetamodelSemantic(org.eclipse.emf.ecore.resource.Resource weavingMetaModel) throws WeaverException
weavingMetaModel
-
WeaverException
public static void refreshResourceFolder(org.eclipse.emf.ecore.resource.Resource res)
res
- A resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |