|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.weaver.plugin.util.WeaverUtil
This class contains convenient static methods for working with the weaver
Constructor Summary | |
WeaverUtil()
|
Method Summary | |
static java.lang.Object |
get(EObject object,
java.lang.String name)
Gets object |
static java.util.List |
getAllEClass(Resource modelResource)
returns all of the EClass for the resource |
static java.util.Collection |
getAllMatchedEObjs(Resource res,
java.lang.String name,
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(Resource modelResource)
returns a list with all packages in a resource |
static boolean |
getBoolean(EObject object,
java.lang.String name)
Gets boolean |
static java.util.List |
getDerivedReferences(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(EObject object)
Gets description |
static EAttribute |
getEAttributeByName(Resource modelResource,
java.lang.String name)
Returns attribute in resource |
static EClass |
getEClassByName(Resource modelResource,
java.lang.String name)
returns the first class in the resource with a given name |
static java.util.Set |
getElementsByType(java.lang.String type,
Resource resource)
Gets a set of elements by type |
static EStructuralFeature |
getEStructuralFeature(EObject eObj,
java.lang.String name)
returns a EStructural feature of the EObject based on its name |
static IIdentifierAdapter |
getIdentifierAdapter(EObject eObj)
returns the adapter capable of generating an ID for a given object |
static int |
getInt(EObject object,
java.lang.String name)
Gets int |
static java.util.List |
getMetamodelPackages(EObject eObj)
returns the metamodel packages related with this eObj |
static java.lang.String |
getName(EObject object)
Gets name |
static EPackage |
getPackage(Resource modelResource,
java.lang.String pkgName)
returns the package of a given resource with a name equals to pkgName |
static java.lang.String |
getString(EObject object,
java.lang.String name)
Gets String |
static java.util.List |
getSubTypeListOf(java.lang.String eClassName,
Resource resource)
returns the list of subtype's name of eClassName in the resource |
static boolean |
isExtends(java.lang.String superClass,
Resource resource)
returns true if subClass extends of superClass(String) in resource |
static boolean |
isInstanceOf(EObject eObj,
java.lang.String classifierName,
java.util.List classifiers)
returns true if this eObj is an instance of the classifier name |
static boolean |
isSuperTypeOf(EClass someClass,
java.lang.String superType,
Resource resource)
returns true if someClass extends of superType(String) in resource |
static void |
set(EObject object,
java.lang.String name,
boolean newValue)
Set boolean |
static void |
set(EObject object,
java.lang.String name,
int newValue)
Sets int |
static void |
set(EObject object,
java.lang.String name,
java.lang.Object newValue)
Set object |
static void |
setDescription(EObject object,
java.lang.String description)
Sets description |
static void |
setName(EObject object,
java.lang.String name)
Sets string |
static void |
setPropertyValue(EObject eObj,
java.lang.Object objValue,
java.lang.String propertyName,
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 EClass getEClassByName(Resource modelResource, java.lang.String name)
modelResource
- name
-
public static java.util.List getAllEClass(Resource modelResource)
modelResource
-
public static EPackage getPackage(Resource modelResource, java.lang.String pkgName)
modelResource
-
public static java.util.List getAllPackages(Resource modelResource)
modelResource
-
public static EStructuralFeature getEStructuralFeature(EObject eObj, java.lang.String name)
eObj
- name
-
public static java.util.Collection getAllMatchedEObjs(Resource res, java.lang.String name, java.lang.String featureName, java.lang.Object featValue)
res
- the resourcename
- the object namefeatureName
- the feature namefeatValue
- the feature value
public static boolean isInstanceOf(EObject eObj, java.lang.String classifierName, java.util.List classifiers)
eObj
- classifiers
- a list of classifiers
public static java.util.List getMetamodelPackages(EObject eObj)
eObj
-
public static boolean isSuperTypeOf(EClass someClass, java.lang.String superType, Resource resource)
someClass
- the EClass to testsuperType
- the name of superclassresource
-
public static java.util.List getSubTypeListOf(java.lang.String eClassName, Resource resource)
eClassName
- the name of the eclassresource
-
public static boolean isExtends(java.lang.String superClass, Resource resource)
superClass
- resource
-
public static java.util.Set getElementsByType(java.lang.String type, Resource resource)
type
- resource
-
public static EAttribute getEAttributeByName(Resource modelResource, java.lang.String name)
modelResource
- name
-
public static java.lang.Object get(EObject object, java.lang.String name)
object
- name
-
public static boolean getBoolean(EObject object, java.lang.String name)
object
- name
-
public static int getInt(EObject object, java.lang.String name)
object
- name
-
public static java.lang.String getString(EObject object, java.lang.String name)
object
- name
-
public static void set(EObject object, java.lang.String name, java.lang.Object newValue)
object
- name
- newValue
- public static void set(EObject object, java.lang.String name, boolean newValue)
object
- name
- newValue
- public static void set(EObject object, java.lang.String name, int newValue)
object
- name
- newValue
- public static void setName(EObject object, java.lang.String name)
object
- name
- public static java.lang.String getName(EObject object)
object
-
public static void setDescription(EObject object, java.lang.String description)
object
- description
- public static java.lang.String getDescription(EObject object)
object
-
public static void setPropertyValue(EObject eObj, java.lang.Object objValue, java.lang.String propertyName, EditingDomain editingDomain)
eObj
- propertyName
- editingDomain
- public static IIdentifierAdapter getIdentifierAdapter(EObject eObj)
eObj
- the object
public static java.util.List getDerivedReferences(Resource resource, java.lang.String eClass, java.lang.String sFeature)
resource
- eClass
- sFeature
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |