org.apache.tuscany.sdo.util
Class DataObjectUtil
java.lang.Object
org.apache.tuscany.sdo.util.DataObjectUtil
public final class DataObjectUtil
- extends Object
Method Summary |
protected static void |
configureResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
|
static void |
configureXMLResource(org.eclipse.emf.ecore.xmi.XMLResource resource,
org.eclipse.emf.ecore.util.ExtendedMetaData extendedMetaData)
|
static DataObject |
create(Type type)
|
static DataObject |
createDataObject(DataObject dataObject,
int propertyIndex)
|
static DataObject |
createDataObject(DataObject dataObject,
int propertyIndex,
String namespaceURI,
String typeName)
|
static DataObject |
createDataObject(DataObject dataObject,
Property property)
|
static DataObject |
createDataObject(DataObject dataObject,
Property property,
Type type)
|
static DataObject |
createDataObject(DataObject dataObject,
String propertyName)
|
static DataObject |
createDataObject(DataObject dataObject,
String propertyName,
String namespaceURI,
String typeName)
|
static org.eclipse.emf.ecore.EClass |
createDocumentRoot()
|
static org.eclipse.emf.ecore.resource.ResourceSet |
createResourceSet()
|
static void |
delete(DataObject dataObject)
|
protected static Property |
demandOpenProperty(Type type,
String name,
Object value,
boolean isSequence)
|
static void |
detach(DataObject dataObject)
|
static Object |
get(DataObject dataObject,
String path)
|
static List |
getAliasNames(org.eclipse.emf.ecore.EClassifier eClassifier)
|
static List |
getAliasNames(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
|
static BigDecimal |
getBigDecimal(DataObject dataObject,
int propertyIndex)
|
static BigDecimal |
getBigDecimal(DataObject dataObject,
Property property)
|
static BigDecimal |
getBigDecimal(Object value)
|
static BigInteger |
getBigInteger(DataObject dataObject,
int propertyIndex)
|
static BigInteger |
getBigInteger(DataObject dataObject,
Property property)
|
static BigInteger |
getBigInteger(Object value)
|
static boolean |
getBoolean(DataObject dataObject,
int propertyIndex)
|
static boolean |
getBoolean(DataObject dataObject,
Property property)
|
static boolean |
getBoolean(Object value)
|
static byte |
getByte(DataObject dataObject,
int propertyIndex)
|
static byte |
getByte(DataObject dataObject,
Property property)
|
static byte |
getByte(Object value)
|
static byte[] |
getBytes(DataObject dataObject,
int propertyIndex)
|
static byte[] |
getBytes(DataObject dataObject,
Property property)
|
static byte[] |
getBytes(Object value)
|
static ChangeSummary |
getChangeSummary(DataObject dataObject)
|
static char |
getChar(DataObject dataObject,
int propertyIndex)
|
static char |
getChar(DataObject dataObject,
Property property)
|
static char |
getChar(Object value)
|
static Property |
getContainmentProperty(Property property)
|
static DataGraph |
getDataGraph(DataObject dataObject)
|
static DataObject |
getDataObject(DataObject dataObject,
int propertyIndex)
|
static DataObject |
getDataObject(DataObject dataObject,
Property property)
|
static Date |
getDate(DataObject dataObject,
int propertyIndex)
|
static Date |
getDate(DataObject dataObject,
Property property)
|
static Date |
getDate(Object value)
|
protected static String |
getDateTypeName(org.eclipse.emf.ecore.EDataType eDataType)
|
static double |
getDouble(DataObject dataObject,
int propertyIndex)
|
static double |
getDouble(DataObject dataObject,
Property property)
|
static double |
getDouble(Object value)
|
static float |
getFloat(DataObject dataObject,
int propertyIndex)
|
static float |
getFloat(DataObject dataObject,
Property property)
|
static float |
getFloat(Object value)
|
protected static Property |
getGlobalProperty(HelperContext hc,
String uri,
String name)
|
static Class |
getImplementationClass(Class instanceClass,
boolean concrete)
|
static List |
getInstanceProperties(DataObject dataObject)
|
static Property |
getInstanceProperty(DataObject dataObject,
String propertyName)
|
static int |
getInt(DataObject dataObject,
int propertyIndex)
|
static int |
getInt(DataObject dataObject,
Property property)
|
static int |
getInt(Object value)
|
static List |
getList(DataObject dataObject,
int propertyIndex)
|
static List |
getList(DataObject dataObject,
Property property)
|
static long |
getLong(DataObject dataObject,
int propertyIndex)
|
static long |
getLong(DataObject dataObject,
Property property)
|
static long |
getLong(Object value)
|
static List |
getMetaObjectInstanceProperties(org.eclipse.emf.ecore.EModelElement metaObject)
Returns a unique list of meta object instance properties (stored in EAnnotations) |
static Object |
getMetaObjectInstanceProperty(org.eclipse.emf.ecore.EModelElement metaObject,
Property property)
Return the value of the specified mata object instance property (stored in EAnnotations) |
static org.eclipse.emf.ecore.EStructuralFeature |
getOpenFeature(org.eclipse.emf.ecore.EObject eObject,
int featureID)
|
static Property |
getProperty(DataObject dataObject,
int propertyIndex)
|
protected static Map |
getRegistrations()
|
static DataObject |
getRootObject(DataObject dataObject)
|
static Sequence |
getSequence(DataObject dataObject,
int propertyIndex)
|
static Sequence |
getSequence(DataObject dataObject,
Property property)
|
static Object |
getSetValue(Property property,
BigDecimal value)
|
static Object |
getSetValue(Property property,
BigInteger value)
|
static Object |
getSetValue(Property property,
boolean value)
|
static Object |
getSetValue(Property property,
byte value)
|
static Object |
getSetValue(Property property,
byte[] value)
|
static Object |
getSetValue(Property property,
char value)
|
static Object |
getSetValue(Property property,
Date value)
|
static Object |
getSetValue(Property property,
double value)
|
static Object |
getSetValue(Property property,
float value)
|
static Object |
getSetValue(Property property,
int value)
|
static Object |
getSetValue(Property property,
long value)
|
static Object |
getSetValue(Property property,
short value)
|
static Object |
getSetValue(Property property,
String value)
|
static short |
getShort(DataObject dataObject,
int propertyIndex)
|
static short |
getShort(DataObject dataObject,
Property property)
|
static short |
getShort(Object value)
|
static String |
getString(DataObject dataObject,
int propertyIndex)
|
static String |
getString(DataObject dataObject,
Property property)
|
static String |
getString(Object value)
|
static Type |
getType(DataObject dataObject,
String namespaceURI,
String typeName)
|
static String |
getXPath(DataObject dataObject)
Configure EMF to support the SDO runtime by registering a specialized Ecore factory, SDOEcoreFactory. |
static void |
initRuntime()
Deprecated. SDO runtime initialization is no longer required |
static boolean |
isInternalProperty(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
|
static boolean |
isSet(DataObject dataObject,
String path)
|
protected static Class |
loadClass(ClassLoader classLoader,
String className)
|
static void |
set(DataObject dataObject,
String path,
Object value)
|
static void |
setBigDecimal(DataObject dataObject,
int propertyIndex,
BigDecimal value)
|
static void |
setBigDecimal(DataObject dataObject,
Property property,
BigDecimal value)
|
static void |
setBigDecimal(DataObject dataObject,
String path,
BigDecimal value)
|
static void |
setBigInteger(DataObject dataObject,
int propertyIndex,
BigInteger value)
|
static void |
setBigInteger(DataObject dataObject,
Property property,
BigInteger value)
|
static void |
setBigInteger(DataObject dataObject,
String path,
BigInteger value)
|
static void |
setBoolean(DataObject dataObject,
int propertyIndex,
boolean value)
|
static void |
setBoolean(DataObject dataObject,
Property property,
boolean value)
|
static void |
setBoolean(DataObject dataObject,
String path,
boolean value)
|
static void |
setByte(DataObject dataObject,
int propertyIndex,
byte value)
|
static void |
setByte(DataObject dataObject,
Property property,
byte value)
|
static void |
setByte(DataObject dataObject,
String path,
byte value)
|
static void |
setBytes(DataObject dataObject,
int propertyIndex,
byte[] value)
|
static void |
setBytes(DataObject dataObject,
Property property,
byte[] value)
|
static void |
setBytes(DataObject dataObject,
String path,
byte[] value)
|
static void |
setChar(DataObject dataObject,
int propertyIndex,
char value)
|
static void |
setChar(DataObject dataObject,
Property property,
char value)
|
static void |
setChar(DataObject dataObject,
String path,
char value)
|
static void |
setDataObject(DataObject dataObject,
int propertyIndex,
DataObject value)
|
static void |
setDataObject(DataObject dataObject,
Property property,
DataObject value)
|
static void |
setDataObject(DataObject dataObject,
String path,
DataObject value)
|
static void |
setDate(DataObject dataObject,
int propertyIndex,
Date value)
|
static void |
setDate(DataObject dataObject,
Property property,
Date value)
|
static void |
setDate(DataObject dataObject,
String path,
Date value)
|
static void |
setDouble(DataObject dataObject,
int propertyIndex,
double value)
|
static void |
setDouble(DataObject dataObject,
Property property,
double value)
|
static void |
setDouble(DataObject dataObject,
String path,
double value)
|
static void |
setFloat(DataObject dataObject,
int propertyIndex,
float value)
|
static void |
setFloat(DataObject dataObject,
Property property,
float value)
|
static void |
setFloat(DataObject dataObject,
String path,
float value)
|
static void |
setInt(DataObject dataObject,
int propertyIndex,
int value)
|
static void |
setInt(DataObject dataObject,
Property property,
int value)
|
static void |
setInt(DataObject dataObject,
String path,
int value)
|
static void |
setList(DataObject dataObject,
int propertyIndex,
List value)
|
static void |
setList(DataObject dataObject,
Property property,
List value)
|
static void |
setList(DataObject dataObject,
String path,
List value)
|
static void |
setLong(DataObject dataObject,
int propertyIndex,
long value)
|
static void |
setLong(DataObject dataObject,
Property property,
long value)
|
static void |
setLong(DataObject dataObject,
String path,
long value)
|
static void |
setShort(DataObject dataObject,
int propertyIndex,
short value)
|
static void |
setShort(DataObject dataObject,
Property property,
short value)
|
static void |
setShort(DataObject dataObject,
String path,
short value)
|
static void |
setString(DataObject dataObject,
int propertyIndex,
String value)
|
static void |
setString(DataObject dataObject,
Property property,
String value)
|
static void |
setString(DataObject dataObject,
String path,
String value)
|
static void |
unset(DataObject dataObject,
String path)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
registrations
protected static Map registrations
globalXMLParserPool
protected static org.eclipse.emf.ecore.xmi.XMLParserPool globalXMLParserPool
DataObjectUtil
public DataObjectUtil()
setString
public static void setString(DataObject dataObject,
Property property,
String value)
setShort
public static void setShort(DataObject dataObject,
Property property,
short value)
setLong
public static void setLong(DataObject dataObject,
Property property,
long value)
setList
public static void setList(DataObject dataObject,
Property property,
List value)
setInt
public static void setInt(DataObject dataObject,
Property property,
int value)
setFloat
public static void setFloat(DataObject dataObject,
Property property,
float value)
setDouble
public static void setDouble(DataObject dataObject,
Property property,
double value)
setDate
public static void setDate(DataObject dataObject,
Property property,
Date value)
setDataObject
public static void setDataObject(DataObject dataObject,
Property property,
DataObject value)
setChar
public static void setChar(DataObject dataObject,
Property property,
char value)
setBytes
public static void setBytes(DataObject dataObject,
Property property,
byte[] value)
setByte
public static void setByte(DataObject dataObject,
Property property,
byte value)
setBoolean
public static void setBoolean(DataObject dataObject,
Property property,
boolean value)
setBigInteger
public static void setBigInteger(DataObject dataObject,
Property property,
BigInteger value)
setBigDecimal
public static void setBigDecimal(DataObject dataObject,
Property property,
BigDecimal value)
getString
public static String getString(DataObject dataObject,
Property property)
getShort
public static short getShort(DataObject dataObject,
Property property)
getSequence
public static Sequence getSequence(DataObject dataObject,
Property property)
getLong
public static long getLong(DataObject dataObject,
Property property)
getList
public static List getList(DataObject dataObject,
Property property)
getInt
public static int getInt(DataObject dataObject,
Property property)
getFloat
public static float getFloat(DataObject dataObject,
Property property)
getDouble
public static double getDouble(DataObject dataObject,
Property property)
getDate
public static Date getDate(DataObject dataObject,
Property property)
getDataObject
public static DataObject getDataObject(DataObject dataObject,
Property property)
getChar
public static char getChar(DataObject dataObject,
Property property)
getBytes
public static byte[] getBytes(DataObject dataObject,
Property property)
getByte
public static byte getByte(DataObject dataObject,
Property property)
getBoolean
public static boolean getBoolean(DataObject dataObject,
Property property)
getBigInteger
public static BigInteger getBigInteger(DataObject dataObject,
Property property)
getBigDecimal
public static BigDecimal getBigDecimal(DataObject dataObject,
Property property)
setString
public static void setString(DataObject dataObject,
int propertyIndex,
String value)
setShort
public static void setShort(DataObject dataObject,
int propertyIndex,
short value)
setLong
public static void setLong(DataObject dataObject,
int propertyIndex,
long value)
setList
public static void setList(DataObject dataObject,
int propertyIndex,
List value)
setInt
public static void setInt(DataObject dataObject,
int propertyIndex,
int value)
setFloat
public static void setFloat(DataObject dataObject,
int propertyIndex,
float value)
setDouble
public static void setDouble(DataObject dataObject,
int propertyIndex,
double value)
setDate
public static void setDate(DataObject dataObject,
int propertyIndex,
Date value)
setDataObject
public static void setDataObject(DataObject dataObject,
int propertyIndex,
DataObject value)
setChar
public static void setChar(DataObject dataObject,
int propertyIndex,
char value)
setBytes
public static void setBytes(DataObject dataObject,
int propertyIndex,
byte[] value)
setByte
public static void setByte(DataObject dataObject,
int propertyIndex,
byte value)
setBoolean
public static void setBoolean(DataObject dataObject,
int propertyIndex,
boolean value)
setBigInteger
public static void setBigInteger(DataObject dataObject,
int propertyIndex,
BigInteger value)
setBigDecimal
public static void setBigDecimal(DataObject dataObject,
int propertyIndex,
BigDecimal value)
getString
public static String getString(DataObject dataObject,
int propertyIndex)
getShort
public static short getShort(DataObject dataObject,
int propertyIndex)
getSequence
public static Sequence getSequence(DataObject dataObject,
int propertyIndex)
getLong
public static long getLong(DataObject dataObject,
int propertyIndex)
getList
public static List getList(DataObject dataObject,
int propertyIndex)
getInt
public static int getInt(DataObject dataObject,
int propertyIndex)
getFloat
public static float getFloat(DataObject dataObject,
int propertyIndex)
getDouble
public static double getDouble(DataObject dataObject,
int propertyIndex)
getDate
public static Date getDate(DataObject dataObject,
int propertyIndex)
getDataObject
public static DataObject getDataObject(DataObject dataObject,
int propertyIndex)
getChar
public static char getChar(DataObject dataObject,
int propertyIndex)
getBytes
public static byte[] getBytes(DataObject dataObject,
int propertyIndex)
getByte
public static byte getByte(DataObject dataObject,
int propertyIndex)
getBoolean
public static boolean getBoolean(DataObject dataObject,
int propertyIndex)
getBigInteger
public static BigInteger getBigInteger(DataObject dataObject,
int propertyIndex)
getBigDecimal
public static BigDecimal getBigDecimal(DataObject dataObject,
int propertyIndex)
detach
public static void detach(DataObject dataObject)
getRootObject
public static DataObject getRootObject(DataObject dataObject)
isInternalProperty
public static boolean isInternalProperty(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
getInstanceProperties
public static List getInstanceProperties(DataObject dataObject)
delete
public static void delete(DataObject dataObject)
createDataObject
public static DataObject createDataObject(DataObject dataObject,
Property property,
Type type)
createDataObject
public static DataObject createDataObject(DataObject dataObject,
int propertyIndex,
String namespaceURI,
String typeName)
createDataObject
public static DataObject createDataObject(DataObject dataObject,
String propertyName,
String namespaceURI,
String typeName)
createDataObject
public static DataObject createDataObject(DataObject dataObject,
Property property)
createDataObject
public static DataObject createDataObject(DataObject dataObject,
int propertyIndex)
createDataObject
public static DataObject createDataObject(DataObject dataObject,
String propertyName)
setString
public static void setString(DataObject dataObject,
String path,
String value)
setShort
public static void setShort(DataObject dataObject,
String path,
short value)
setLong
public static void setLong(DataObject dataObject,
String path,
long value)
setList
public static void setList(DataObject dataObject,
String path,
List value)
setInt
public static void setInt(DataObject dataObject,
String path,
int value)
setFloat
public static void setFloat(DataObject dataObject,
String path,
float value)
setDouble
public static void setDouble(DataObject dataObject,
String path,
double value)
setDate
public static void setDate(DataObject dataObject,
String path,
Date value)
setDataObject
public static void setDataObject(DataObject dataObject,
String path,
DataObject value)
setChar
public static void setChar(DataObject dataObject,
String path,
char value)
setBytes
public static void setBytes(DataObject dataObject,
String path,
byte[] value)
setByte
public static void setByte(DataObject dataObject,
String path,
byte value)
setBoolean
public static void setBoolean(DataObject dataObject,
String path,
boolean value)
setBigInteger
public static void setBigInteger(DataObject dataObject,
String path,
BigInteger value)
setBigDecimal
public static void setBigDecimal(DataObject dataObject,
String path,
BigDecimal value)
getDataGraph
public static DataGraph getDataGraph(DataObject dataObject)
getChangeSummary
public static ChangeSummary getChangeSummary(DataObject dataObject)
unset
public static void unset(DataObject dataObject,
String path)
isSet
public static boolean isSet(DataObject dataObject,
String path)
set
public static void set(DataObject dataObject,
String path,
Object value)
get
public static Object get(DataObject dataObject,
String path)
getBigDecimal
public static BigDecimal getBigDecimal(Object value)
getSetValue
public static Object getSetValue(Property property,
BigDecimal value)
getBigInteger
public static BigInteger getBigInteger(Object value)
getSetValue
public static Object getSetValue(Property property,
BigInteger value)
getBoolean
public static boolean getBoolean(Object value)
getSetValue
public static Object getSetValue(Property property,
boolean value)
getByte
public static byte getByte(Object value)
getSetValue
public static Object getSetValue(Property property,
byte value)
getBytes
public static byte[] getBytes(Object value)
getSetValue
public static Object getSetValue(Property property,
byte[] value)
getChar
public static char getChar(Object value)
getSetValue
public static Object getSetValue(Property property,
char value)
getDate
public static Date getDate(Object value)
getSetValue
public static Object getSetValue(Property property,
Date value)
getDateTypeName
protected static String getDateTypeName(org.eclipse.emf.ecore.EDataType eDataType)
getDouble
public static double getDouble(Object value)
getSetValue
public static Object getSetValue(Property property,
double value)
getFloat
public static float getFloat(Object value)
getSetValue
public static Object getSetValue(Property property,
float value)
getInt
public static int getInt(Object value)
getSetValue
public static Object getSetValue(Property property,
int value)
getLong
public static long getLong(Object value)
getSetValue
public static Object getSetValue(Property property,
long value)
getShort
public static short getShort(Object value)
getSetValue
public static Object getSetValue(Property property,
short value)
getString
public static String getString(Object value)
getSetValue
public static Object getSetValue(Property property,
String value)
getOpenFeature
public static org.eclipse.emf.ecore.EStructuralFeature getOpenFeature(org.eclipse.emf.ecore.EObject eObject,
int featureID)
getAliasNames
public static List getAliasNames(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
getAliasNames
public static List getAliasNames(org.eclipse.emf.ecore.EClassifier eClassifier)
demandOpenProperty
protected static Property demandOpenProperty(Type type,
String name,
Object value,
boolean isSequence)
getType
public static Type getType(DataObject dataObject,
String namespaceURI,
String typeName)
getInstanceProperty
public static Property getInstanceProperty(DataObject dataObject,
String propertyName)
getProperty
public static Property getProperty(DataObject dataObject,
int propertyIndex)
getContainmentProperty
public static Property getContainmentProperty(Property property)
create
public static DataObject create(Type type)
createResourceSet
public static org.eclipse.emf.ecore.resource.ResourceSet createResourceSet()
getRegistrations
protected static Map getRegistrations()
configureResourceSet
protected static void configureResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
createDocumentRoot
public static org.eclipse.emf.ecore.EClass createDocumentRoot()
getXPath
public static String getXPath(DataObject dataObject)
- Configure EMF to support the SDO runtime by registering a specialized Ecore factory, SDOEcoreFactory.
This static initializion must run before any SDO metadata is created or loaded.
As long as SDO helper classes (e.g., TypeHelper, XMLHelper, etc.) are accessed though their
corresponding INSTANCE fields (e.g., TypeHelper.INSTANCE), or using the SDOUtil methods (e.g.,
SDOUtil.createTypeHelper(), this will always be the case.
configureXMLResource
public static void configureXMLResource(org.eclipse.emf.ecore.xmi.XMLResource resource,
org.eclipse.emf.ecore.util.ExtendedMetaData extendedMetaData)
initRuntime
public static void initRuntime()
- Deprecated. SDO runtime initialization is no longer required
getMetaObjectInstanceProperties
public static List getMetaObjectInstanceProperties(org.eclipse.emf.ecore.EModelElement metaObject)
- Returns a unique list of meta object instance properties (stored in EAnnotations)
- Parameters:
metaObject
- - A Type or Property instance
- Returns:
- A list of commonj.sdo.Property instances
getMetaObjectInstanceProperty
public static Object getMetaObjectInstanceProperty(org.eclipse.emf.ecore.EModelElement metaObject,
Property property)
- Return the value of the specified mata object instance property (stored in EAnnotations)
- Parameters:
metaObject
- - A Type or Property instanceproperty
- - The instance property to retrieve
- Returns:
- The value of the instance property
getGlobalProperty
protected static Property getGlobalProperty(HelperContext hc,
String uri,
String name)
loadClass
protected static Class loadClass(ClassLoader classLoader,
String className)
getImplementationClass
public static Class getImplementationClass(Class instanceClass,
boolean concrete)
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.