|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmt.weaver.plugin.util.WeaverUtil
public class WeaverUtil
This class contains convenient static methods for working with the weaver
Constructor Summary | |
---|---|
WeaverUtil()
|
Method Summary | |
---|---|
static int |
countElements(org.eclipse.emf.ecore.resource.Resource resource)
returns the total number of elements of a given resource |
static java.lang.Object |
get(org.eclipse.emf.ecore.EObject object,
java.lang.String name)
Gets object |
static java.util.List |
getAllEClass(org.eclipse.emf.ecore.resource.Resource modelResource)
returns all of the EClass for the resource |
static java.util.Collection |
getAllMatchedEObjs(org.eclipse.emf.ecore.resource.Resource res,
java.lang.String className,
java.lang.String featureName,
java.lang.Object featValue)
returns the object (or objects if it is a reference) of a given resource that matches the feature name and value for an object |
static java.util.List |
getAllPackages(org.eclipse.emf.ecore.resource.Resource modelResource)
returns a list with all packages in a resource |
static java.lang.String |
getAnnotationRefType(org.eclipse.emf.ecore.EClass eClass)
returns the name of the class of welementref (saved as an annotation) (if it does not exists, returns ownedElementRef for the moment every model ref class must have an ownedelementrefannotation |
static boolean |
getBoolean(org.eclipse.emf.ecore.EObject object,
java.lang.String name)
Gets boolean |
static org.eclipse.emf.ecore.EClassifier |
getClassifier(java.lang.String name,
org.eclipse.emf.ecore.resource.Resource resource)
Returns classifier in the resource (for this name) |
static org.eclipse.debug.core.ILaunchConfiguration |
getConfig(java.lang.String fName)
returns a launch configuration of a transformation with the given launch configuration file name |
static java.util.List |
getDerivedReferences(org.eclipse.emf.ecore.resource.Resource resource,
java.lang.String eClass,
java.lang.String sFeature)
returns the derived values for the feature of a class |
static java.lang.String |
getDescription(org.eclipse.emf.ecore.EObject object)
Gets description |
static org.eclipse.emf.ecore.EAttribute |
getEAttributeByName(org.eclipse.emf.ecore.resource.Resource modelResource,
java.lang.String name)
Returns attribute in resource |
static org.eclipse.emf.ecore.EClass |
getEClassByName(org.eclipse.emf.ecore.resource.Resource modelResource,
java.lang.String name)
returns the first class in the resource with a given name |
static java.util.List |
getElementsByType(java.lang.String type,
org.eclipse.emf.ecore.resource.Resource resource)
Gets a set of elements by type |
static java.util.List |
getElementsByTypeHierarchy(java.lang.String type,
org.eclipse.emf.ecore.resource.Resource resource)
Gets a set of elements by type, and navigates in the hierarchy goes up trhough the hierarchy |
static org.eclipse.emf.ecore.EStructuralFeature |
getEStructuralFeature(org.eclipse.emf.ecore.EObject eObj,
java.lang.String name)
returns a EStructural feature of the EObject based on its name |
static IIdentifierAdapter |
getIdentifierAdapter(org.eclipse.emf.ecore.EObject eObj)
returns the adapter capable of generating an ID for a given object |
static IIdentifierAdapter |
getIdentifierAdapter(org.eclipse.emf.ecore.resource.Resource resource)
returns the adapter capable of generating an ID for a resource |
static int |
getInt(org.eclipse.emf.ecore.EObject object,
java.lang.String name)
Gets int |
static java.util.List |
getMetamodelPackages(org.eclipse.emf.ecore.EObject eObj)
returns the metamodel packages related with this eObj |
static java.lang.String |
getName(org.eclipse.emf.ecore.EObject object)
Gets name |
static org.eclipse.emf.ecore.EPackage |
getPackage(org.eclipse.emf.ecore.resource.Resource modelResource,
java.lang.String pkgName)
returns the package of a given resource with a name equals to pkgName |
static org.eclipse.core.runtime.IPath |
getPropertyFilePath(org.eclipse.core.resources.IFile file)
gets the property file complete path |
static java.lang.String |
getString(org.eclipse.emf.ecore.EObject object,
java.lang.String name)
Gets String |
static java.util.List |
getSubTypeListOf(java.lang.String eClassName,
org.eclipse.emf.ecore.resource.Resource resource)
returns the list of subtype's name of eClassName in the resource |
static java.util.List |
getWModelRefReferences(org.eclipse.emf.ecore.resource.Resource resource,
java.lang.String className)
returns all the references to WModelREf from o given class |
static boolean |
isExtends(java.lang.String superClass,
org.eclipse.emf.ecore.resource.Resource resource)
returns true if subClass extends of superClass(String) in resource |
static boolean |
isInstanceOf(org.eclipse.emf.ecore.EObject eObj,
java.lang.String classifierName,
java.util.List classifiers)
returns true if this eObj is an instance of the classifier name |
static boolean |
isInstanceOf(org.eclipse.emf.ecore.EObject eObj,
java.lang.String classifierName,
org.eclipse.emf.ecore.resource.Resource resource)
returns true if this eObj is an instance of the classifier name |
static boolean |
isSuperTypeOf(org.eclipse.emf.ecore.EClass someClass,
java.lang.String superType,
org.eclipse.emf.ecore.resource.Resource resource)
returns true if someClass extends of superType(String) in resource |
static void |
set(org.eclipse.emf.ecore.EObject object,
java.lang.String name,
boolean newValue)
Set boolean |
static void |
set(org.eclipse.emf.ecore.EObject object,
java.lang.String name,
int newValue)
Sets int |
static void |
set(org.eclipse.emf.ecore.EObject object,
java.lang.String name,
java.lang.Object newValue)
Set object |
static void |
setDescription(org.eclipse.emf.ecore.EObject object,
java.lang.String description)
Sets description |
static void |
setName(org.eclipse.emf.ecore.EObject object,
java.lang.String name)
Sets string |
static void |
setPropertyValue(org.eclipse.emf.ecore.EObject eObj,
java.lang.Object objValue,
java.lang.String propertyName,
org.eclipse.emf.edit.domain.EditingDomain editingDomain)
Sets a property value for a given EObject based on the metamodel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WeaverUtil()
Method Detail |
---|
public static org.eclipse.emf.ecore.EClassifier getClassifier(java.lang.String name, org.eclipse.emf.ecore.resource.Resource resource)
name
- resource
-
public static org.eclipse.emf.ecore.EClass getEClassByName(org.eclipse.emf.ecore.resource.Resource modelResource, java.lang.String name)
modelResource
- name
-
public static java.util.List getAllEClass(org.eclipse.emf.ecore.resource.Resource modelResource)
modelResource
- name
-
public static org.eclipse.emf.ecore.EPackage getPackage(org.eclipse.emf.ecore.resource.Resource modelResource, java.lang.String pkgName)
modelResource
-
public static int countElements(org.eclipse.emf.ecore.resource.Resource resource)
resource
-
public static java.util.List getAllPackages(org.eclipse.emf.ecore.resource.Resource modelResource)
modelResource
-
public static org.eclipse.emf.ecore.EStructuralFeature getEStructuralFeature(org.eclipse.emf.ecore.EObject eObj, java.lang.String name)
eObj
- name
-
public static java.util.Collection getAllMatchedEObjs(org.eclipse.emf.ecore.resource.Resource res, java.lang.String className, java.lang.String featureName, java.lang.Object featValue)
res
- the resourcename
- the object class namefeatureName
- the feature namefeatValue
- the feature value
public static boolean isInstanceOf(org.eclipse.emf.ecore.EObject eObj, java.lang.String classifierName, java.util.List classifiers)
eObj
- className
- classifiers
- a list of classifiers
public static boolean isInstanceOf(org.eclipse.emf.ecore.EObject eObj, java.lang.String classifierName, org.eclipse.emf.ecore.resource.Resource resource)
eObj
- classifierName
- resource
- (metamodel) a resource with classifiers
public static java.util.List getMetamodelPackages(org.eclipse.emf.ecore.EObject eObj)
eObj
-
public static boolean isSuperTypeOf(org.eclipse.emf.ecore.EClass someClass, java.lang.String superType, org.eclipse.emf.ecore.resource.Resource resource)
someClass
- the EClass to testsuperType
- the name of superclassresource
-
public static java.util.List getSubTypeListOf(java.lang.String eClassName, org.eclipse.emf.ecore.resource.Resource resource)
eClassName
- the name of the eclassresource
-
public static boolean isExtends(java.lang.String superClass, org.eclipse.emf.ecore.resource.Resource resource)
superClass
- subClass
- resource
-
public static java.util.List getElementsByType(java.lang.String type, org.eclipse.emf.ecore.resource.Resource resource)
type
- resource
-
public static java.util.List getElementsByTypeHierarchy(java.lang.String type, org.eclipse.emf.ecore.resource.Resource resource)
type
- resource
-
public static org.eclipse.emf.ecore.EAttribute getEAttributeByName(org.eclipse.emf.ecore.resource.Resource modelResource, java.lang.String name)
modelResource
- name
-
public static java.lang.Object get(org.eclipse.emf.ecore.EObject object, java.lang.String name)
object
- name
-
public static boolean getBoolean(org.eclipse.emf.ecore.EObject object, java.lang.String name)
object
- name
-
public static int getInt(org.eclipse.emf.ecore.EObject object, java.lang.String name)
object
- name
-
public static java.lang.String getString(org.eclipse.emf.ecore.EObject object, java.lang.String name)
object
- name
-
public static void set(org.eclipse.emf.ecore.EObject object, java.lang.String name, java.lang.Object newValue)
object
- name
- newValue
- public static void set(org.eclipse.emf.ecore.EObject object, java.lang.String name, boolean newValue)
object
- name
- newValue
- public static void set(org.eclipse.emf.ecore.EObject object, java.lang.String name, int newValue)
object
- name
- newValue
- public static void setName(org.eclipse.emf.ecore.EObject object, java.lang.String name)
object
- name
- public static java.lang.String getName(org.eclipse.emf.ecore.EObject object)
object
-
public static void setDescription(org.eclipse.emf.ecore.EObject object, java.lang.String description)
object
- description
- public static java.lang.String getDescription(org.eclipse.emf.ecore.EObject object)
object
-
public static void setPropertyValue(org.eclipse.emf.ecore.EObject eObj, java.lang.Object objValue, java.lang.String propertyName, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
eObj
- propValue
- propertyName
- editingDomain
- public static IIdentifierAdapter getIdentifierAdapter(org.eclipse.emf.ecore.EObject eObj)
eObj
- the object
public static IIdentifierAdapter getIdentifierAdapter(org.eclipse.emf.ecore.resource.Resource resource)
eObj
- the object
public static java.lang.String getAnnotationRefType(org.eclipse.emf.ecore.EClass eClass)
eClass
-
public static java.util.List getDerivedReferences(org.eclipse.emf.ecore.resource.Resource resource, java.lang.String eClass, java.lang.String sFeature)
resource
- eClass
- sFeature
-
public static java.util.List getWModelRefReferences(org.eclipse.emf.ecore.resource.Resource resource, java.lang.String className)
resource
- eClass
- sFeature
-
public static org.eclipse.core.runtime.IPath getPropertyFilePath(org.eclipse.core.resources.IFile file)
file
-
public static org.eclipse.debug.core.ILaunchConfiguration getConfig(java.lang.String fName)
fName
- launch configuration file name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |