org.openxma.dsl.common.jdt
Class JdtXTextResourceSetUtils

java.lang.Object
  extended by org.openxma.dsl.common.jdt.JdtXTextResourceSetUtils

public class JdtXTextResourceSetUtils
extends java.lang.Object

Utility to operate with XMAComponents, XTextResourceSets and Jdt


Constructor Summary
JdtXTextResourceSetUtils()
           
 
Method Summary
static org.eclipse.emf.ecore.resource.Resource createStandardEmfResource(org.eclipse.core.resources.IFile file)
          Create a new standard emf Resource in a new standard emf ResourceSet.
static org.eclipse.xtext.resource.XtextResource createXtextResource(org.eclipse.core.resources.IFile file)
          Create a new XtextResource in a new XtextResourceSet
static org.eclipse.xtext.resource.XtextResource createXtextResource(org.eclipse.xtext.resource.XtextResourceSet xtextResourceSet, org.eclipse.core.resources.IFile file)
          Create a new XtextResource in a given XtextResourceSet
static org.eclipse.xtext.resource.XtextResourceSet createXTextResourceSetForProject(org.eclipse.core.resources.IProject project)
          Creates a XTextResourceSet for a IProject
static java.lang.String getClassPathUriForXMAFile(org.eclipse.core.resources.IFile xmaFile)
          Get the classpath uri for a XMA-file.
static org.eclipse.emf.ecore.resource.Resource getResourceForXMAFile(org.eclipse.core.resources.IFile xmaFile)
          Get the resource for a XMA-file within a new created XTextResourceSet
static org.eclipse.emf.ecore.resource.Resource getResourceForXMAFile(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.core.resources.IFile xmaFile)
          Get the resource for a XMA-file in a given ResourceSet.
static java.lang.String getSourceFolderRelativeFolderPath(org.eclipse.core.resources.IResource resource)
          Get the folder-path for a resource relative to the XMA-sourcefolder.
static java.lang.String getSourceFolderRelativePath(org.eclipse.core.resources.IResource xmaFile)
          Get the path for a resource relative to the XMA-sourcefolder.
static XMAComponent getXMAComponent(org.eclipse.core.resources.IFile xmaFile)
          Get the XMAComponent from a file.
static XMAComponent getXMAComponentForResource(org.eclipse.emf.ecore.resource.Resource xmaResource)
          Get the XMAComponent from a Resource.
static java.lang.String removeTrailingSlash(java.lang.String string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdtXTextResourceSetUtils

public JdtXTextResourceSetUtils()
Method Detail

createXTextResourceSetForProject

public static org.eclipse.xtext.resource.XtextResourceSet createXTextResourceSetForProject(org.eclipse.core.resources.IProject project)
Creates a XTextResourceSet for a IProject

Parameters:
project -
Returns:

getSourceFolderRelativePath

public static java.lang.String getSourceFolderRelativePath(org.eclipse.core.resources.IResource xmaFile)
Get the path for a resource relative to the XMA-sourcefolder.

Parameters:
xmaFile -
Returns:

getSourceFolderRelativeFolderPath

public static java.lang.String getSourceFolderRelativeFolderPath(org.eclipse.core.resources.IResource resource)
Get the folder-path for a resource relative to the XMA-sourcefolder.

Parameters:
resource -
Returns:

removeTrailingSlash

public static java.lang.String removeTrailingSlash(java.lang.String string)

getClassPathUriForXMAFile

public static java.lang.String getClassPathUriForXMAFile(org.eclipse.core.resources.IFile xmaFile)
Get the classpath uri for a XMA-file.

Parameters:
xmaFile -
Returns:

getResourceForXMAFile

public static org.eclipse.emf.ecore.resource.Resource getResourceForXMAFile(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                                                                            org.eclipse.core.resources.IFile xmaFile)
Get the resource for a XMA-file in a given ResourceSet.

Parameters:
resourceSet -
xmaFile -
Returns:

getResourceForXMAFile

public static org.eclipse.emf.ecore.resource.Resource getResourceForXMAFile(org.eclipse.core.resources.IFile xmaFile)
Get the resource for a XMA-file within a new created XTextResourceSet

Parameters:
xmaFile -
Returns:

getXMAComponentForResource

public static XMAComponent getXMAComponentForResource(org.eclipse.emf.ecore.resource.Resource xmaResource)
Get the XMAComponent from a Resource.

Parameters:
xmaResource -
Returns:
null in case there is no XMAComponent in the Resource

getXMAComponent

public static XMAComponent getXMAComponent(org.eclipse.core.resources.IFile xmaFile)
Get the XMAComponent from a file. The resource for the file is created within a XTextResource.

Parameters:
xmaFile -
Returns:
null in case there is no XMAComponent in the file

createXtextResource

public static org.eclipse.xtext.resource.XtextResource createXtextResource(org.eclipse.xtext.resource.XtextResourceSet xtextResourceSet,
                                                                           org.eclipse.core.resources.IFile file)
Create a new XtextResource in a given XtextResourceSet

Parameters:
xtextResourceSet -
file -
Returns:

createXtextResource

public static org.eclipse.xtext.resource.XtextResource createXtextResource(org.eclipse.core.resources.IFile file)
Create a new XtextResource in a new XtextResourceSet

Parameters:
file -
Returns:

createStandardEmfResource

public static org.eclipse.emf.ecore.resource.Resource createStandardEmfResource(org.eclipse.core.resources.IFile file)
Create a new standard emf Resource in a new standard emf ResourceSet.

Parameters:
file -
Returns:


Copyright © 2012. All Rights Reserved.