|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.xml.EMFUtils
public class EMFUtils
Utility methods for working with emf model objects.
Constructor Summary | |
---|---|
EMFUtils()
|
Method Summary | |
---|---|
static void |
add(org.eclipse.emf.ecore.EObject eobject,
java.lang.String property,
java.lang.Object value)
Adds a value to a multi-valued propert of an eobject. |
static org.eclipse.emf.ecore.EObject |
clone(org.eclipse.emf.ecore.EObject prototype,
org.eclipse.emf.ecore.EFactory factory)
Deprecated. use clone(EObject, EFactory, boolean) . |
static org.eclipse.emf.ecore.EObject |
clone(org.eclipse.emf.ecore.EObject prototype,
org.eclipse.emf.ecore.EFactory factory,
boolean deep)
Clones an eobject, with the option of performing a deep clone in which referenced eobjects are also cloned. |
static void |
copy(org.eclipse.emf.ecore.EObject source,
org.eclipse.emf.ecore.EObject target)
Copies all the properties from one object to anoter. |
static org.eclipse.emf.ecore.EStructuralFeature |
feature(org.eclipse.emf.ecore.EObject eobject,
java.lang.String property)
Method which looks up a structure feature of an eobject, first doing an exact name match, then a case insensitive one. |
static java.util.List |
features(org.eclipse.emf.ecore.EObject eobject,
java.lang.Class propertyType)
Method which looks up structural features of an eobject by type. |
static java.lang.Object |
get(org.eclipse.emf.ecore.EObject eobject,
java.lang.String property)
Gets the property of an eobject. |
static java.util.List |
get(java.util.List objects,
java.lang.String property)
Obtains the values of a particular property on each EObject in a list. |
static boolean |
has(org.eclipse.emf.ecore.EObject eobject,
java.lang.String property)
Determines if an eobject has a particular property. |
static boolean |
isCollection(org.eclipse.emf.ecore.EObject eobject,
java.lang.String property)
Determines if a property of an eobject is a collection. |
static boolean |
isSet(org.eclipse.emf.ecore.EObject eobject,
java.lang.String property)
Determines if a particular propety has been set on an eobject. |
static boolean |
isSet(java.util.List objects,
java.lang.String property)
Determines if a particular propety has been set on each EObject in a list. |
static boolean |
isUnset(java.util.List objects,
java.lang.String property)
Determines if a particular propety is unset on each EObject in a list. |
static void |
set(org.eclipse.emf.ecore.EObject eobject,
java.lang.String property,
java.lang.Object value)
Sets a property of an eobject. |
static void |
set(java.util.List objects,
java.lang.String property,
java.util.List values)
Sets a particular property on each EObject in a list to a particular value. |
static void |
set(java.util.List objects,
java.lang.String property,
java.lang.Object value)
Sets a particular property on each EObject in a list to a particular value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EMFUtils()
Method Detail |
---|
public static boolean has(org.eclipse.emf.ecore.EObject eobject, java.lang.String property)
eobject
- The eobject.property
- The property to check for.
true
if the property exists, otherwise false
public static void set(org.eclipse.emf.ecore.EObject eobject, java.lang.String property, java.lang.Object value)
eobject
- THe object.property
- The property to set.value
- The value of the property.public static java.lang.Object get(org.eclipse.emf.ecore.EObject eobject, java.lang.String property)
eobject
- The object.property
- The property to get.
public static void add(org.eclipse.emf.ecore.EObject eobject, java.lang.String property, java.lang.Object value)
The property must map to a multi-valued property of the
eobject. The isCollection(EObject, String)
method can be used
to test this.
eobject
- The object.property
- The multi-valued property.value
- The value to add.public static boolean isCollection(org.eclipse.emf.ecore.EObject eobject, java.lang.String property)
In the event the property does not exist, this method will return
false
true
if hte property is a collection, otherwise
false
public static org.eclipse.emf.ecore.EStructuralFeature feature(org.eclipse.emf.ecore.EObject eobject, java.lang.String property)
eobject
- The eobject.property
- The property
null
if not found.public static java.util.List features(org.eclipse.emf.ecore.EObject eobject, java.lang.Class propertyType)
eobject
- The eobject.propertyType
- The type of the properties.
public static void set(java.util.List objects, java.lang.String property, java.util.List values)
EObject
in a list to a particular value.
The following must hold:
objects.size() == values.size()
objects
- A list of EObject
.property
- The property to set on each eobject in objects
values
- The value to set on each eobjct in objects
public static void set(java.util.List objects, java.lang.String property, java.lang.Object value)
EObject
in a list to a particular value.
objects
- A list of EObject
.property
- The property to set on each eobject in objects
value
- The value to set on each eobjct in objects
public static java.util.List get(java.util.List objects, java.lang.String property)
EObject
in a list.
objects
- A list of EObject
.property
- The property to obtain.
public static boolean isSet(org.eclipse.emf.ecore.EObject eobject, java.lang.String property)
eobjects
- The eobject.property
- The property to check.
true
if the property has been set, otherwise false
public static boolean isSet(java.util.List objects, java.lang.String property)
EObject
in a list.
objects
- A list of EObject
property
- The property to check.
true
if every element in the list has been set, otherwise false
public static boolean isUnset(java.util.List objects, java.lang.String property)
EObject
in a list.
objects
- A list of EObject
property
- The property to check.
true
if every element in the list is unset, otherwise false
public static org.eclipse.emf.ecore.EObject clone(org.eclipse.emf.ecore.EObject prototype, org.eclipse.emf.ecore.EFactory factory)
clone(EObject, EFactory, boolean)
.
prototype
- The object to be cloned from.factory
- The factory used to create the clone.
public static org.eclipse.emf.ecore.EObject clone(org.eclipse.emf.ecore.EObject prototype, org.eclipse.emf.ecore.EFactory factory, boolean deep)
prototype
- The object to be cloned from.factory
- The factory used to create the clone.deepÊFlag
- indicating wether to perform a deep clone.
public static void copy(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target)
source
- The object to copy from.target
- The object to copy to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |