From ece4fd35da7b7fc76264776f81705e6b5b52d3e0 Mon Sep 17 00:00:00 2001
From: lresende
- * The {@link #isCreated new} and {@link #isModified modified} objects in the List are references to objects
- * associated with this ChangeSummary.
- * The {@link #isDeleted deleted} objects in the List are references to objects
- * at the time that event logging was enabled;
- * Each changed object must have exactly one of the following methods return true:
- * {@link #isCreated isCreated},
- * {@link #isDeleted isDeleted}, or
- * {@link #isModified isModified}.
- * @return a list of changed data objects.
- * @see #isCreated(DataObject)
- * @see #isDeleted(DataObject)
- * @see #isModified(DataObject)
- */
- List /*DataObject*/ getChangedDataObjects();
-
- /**
- * Returns whether or not the specified data object was created while {@link #isLogging logging}.
- * Any object that was added to the scope
- * but was not in the scope when logging began,
- * will be considered created.
- * @param dataObject the data object in question.
- * @return In the case of a {@link #isDeleted(DataObject) deleted} object,
- * the List will include settings for all the Properties.
- * An old value setting indicates the value at the
- * point logging begins. A setting is only produced for
- * {@link #isModified modified} objects if
- * either the old value differs from the current value or
- * if the isSet differs from the current value.
- * No settings are produced for {@link #isCreated created} objects.
- * @param dataObject the object in question.
- * @return a list of settings.
- * @see #getChangedDataObjects
- */
- List /*ChangeSummary.Setting*/ getOldValues(DataObject dataObject);
-
- /**
- * Clears the List of {@link #getChangedDataObjects changes} and turns change logging on.
- * No operation occurs if logging is already on.
- * @see #endLogging
- * @see #isLogging
- */
- void beginLogging();
-
- /**
- * An implementation that requires logging may throw an UnsupportedOperationException.
- * Turns change logging off. No operation occurs if logging is already off.
- * @see #beginLogging
- * @see #isLogging
- */
- void endLogging();
-
-
- /**
- * Returns whether or not the specified data object was updated while {@link #isLogging logging}.
- * An object that was contained in the scope when logging began
- * and remains in the scope when logging ends will be considered potentially modified.
- * An object considered modified must have at least one old value setting.
- * @param dataObject the data object in question.
- * @return Returns null if the property was not modified and
- * has not been {@link #isDeleted(DataObject) deleted}.
- * @param dataObject the object in question.
- * @param property the property of the object.
- * @return the Setting for the specified property.
- * @see #getChangedDataObjects
- */
- Setting getOldValue(DataObject dataObject, Property property);
-
- /**
- * Returns the value of the {@link DataObject#getContainer container} data object
- * at the point when logging {@link #beginLogging() began}.
- * @param dataObject the object in question.
- * @return the old container data object.
- */
- DataObject getOldContainer(DataObject dataObject);
-
- /**
- * Returns the value of the {@link DataObject#getContainmentProperty containment property} data object property
- * at the point when logging {@link #beginLogging() began}.
- * @param dataObject the object in question.
- * @return the old containment property.
- */
- Property getOldContainmentProperty(DataObject dataObject);
-
- /**
- * Returns the value of the {@link DataObject#getSequence sequence} for the data object
- * at the point when logging {@link #beginLogging() began}.
- * @param dataObject the object in question.
- * @return the old containment property.
- */
- Sequence getOldSequence(DataObject dataObject);
-
- /**
- * This method is intended for use by service implementations only.
- * Undoes all changes in the log to restore the tree of
- * DataObjects to its original state when logging began.
- * isLogging() is unchanged. The log is cleared.
- * @see #beginLogging
- * @see #endLogging
- * @see #isLogging
- */
- void undoChanges();
-
-}
diff --git a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/DataGraph.java b/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/DataGraph.java
deleted file mode 100644
index 78bc7227a1..0000000000
--- a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/DataGraph.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- *
- * Each data object holds its data as a series of {@link Property Properties}.
- * Properties can be accessed by name, property index, or using the property meta object itself.
- * A data object can also contain references to other data objects, through reference-type Properties.
- *
- * A data object has a series of convenience accessors for its Properties.
- * These methods either use a path (String),
- * a property index,
- * or the {@link Property property's meta object} itself, to identify the property.
- * Some examples of the path-based accessors are as follows:
- * There are general accessors for Properties, i.e., {@link #get(Property) get} and {@link #set(Property, Object) set},
- * as well as specific accessors for the primitive types and commonly used data types like
- * String, Date, List, BigInteger, and BigDecimal.
- */
-public interface DataObject extends Serializable
-{
- /**
- * Returns the value of a property of either this object or an object reachable from it, as identified by the
- * specified path.
- * @param path the path to a valid object and property.
- * @return the value of the specified property.
- * @see #get(Property)
- */
- Object get(String path);
-
- /**
- * Sets a property of either this object or an object reachable from it, as identified by the specified path,
- * to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void set(String path, Object value);
-
- /**
- * Returns whether a property of either this object or an object reachable from it, as identified by the specified path,
- * is considered to be set.
- * @param path the path to a valid object and property.
- * @see #isSet(Property)
- */
- boolean isSet(String path);
-
- /**
- * Unsets a property of either this object or an object reachable from it, as identified by the specified path.
- * @param path the path to a valid object and property.
- * @see #unset(Property)
- */
- void unset(String path);
-
- /**
- * Returns the value of a
- * If the property is {@link Property#isMany many-valued},
- * the result will be a {@link java.util.List}
- * and each object in the List will be {@link Type#isInstance an instance of}
- * the property's {@link Property#getType type}.
- * Otherwise the result will directly be an instance of the property's type.
- * @param property the property of the value to fetch.
- * @return the value of the given property of the object.
- * @see #set(Property, Object)
- * @see #unset(Property)
- * @see #isSet(Property)
- */
- Object get(Property property);
-
- /**
- * Sets the value of the given property of the object to the new value.
- *
- * If the property is {@link Property#isMany many-valued},
- * the new value must be a {@link java.util.List}
- * and each object in that list must be {@link Type#isInstance an instance of}
- * the property's {@link Property#getType type};
- * the existing contents are cleared and the contents of the new value are added.
- * Otherwise the new value directly must be an instance of the property's type
- * and it becomes the new value of the property of the object.
- * @param property the property of the value to set.
- * @param value the new value for the property.
- * @see #unset(Property)
- * @see #isSet(Property)
- * @see #get(Property)
- */
- void set(Property property, Object value);
-
- /**
- * Returns whether the property of the object is considered to be set.
- *
- * isSet() for many-valued Properties returns true if the List is not empty and
- * false if the List is empty. For single-valued Properties:
- *
- * @param property the property in question.
- * @return whether the property of the object is set.
- * @see #set(Property, Object)
- * @see #unset(Property)
- * @see #get(Property)
- */
- boolean isSet(Property property);
-
- /**
- * Unsets the property of the object.
- *
- * If the property is {@link Property#isMany many-valued},
- * the value must be an {@link java.util.List}
- * and that list is cleared.
- * Otherwise,
- * the value of the property of the object
- * is set to the property's {@link Property#getDefault default value}.
- * The property will no longer be considered {@link #isSet set}.
- * @param property the property in question.
- * @see #isSet(Property)
- * @see #set(Property, Object)
- * @see #get(Property)
- */
- void unset(Property property);
-
- /**
- * Returns the value of the specified The new value must be a {@link java.util.List}
- * and each object in that list must be {@link Type#isInstance an instance of}
- * the property's {@link Property#getType type};
- * the existing contents are cleared and the contents of the new value are added.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setList(Property property, List value);
-
- /**
- * Returns a new {@link DataObject data object} contained by this object using the specified property,
- * which must be a {@link Property#isContainment containment property}.
- * The type of the created object is the {@link Property#getType declared type} of the specified property.
- * @param propertyName the name of the specified containment property.
- * @return the created data object.
- * @see #createDataObject(String, String, String)
- */
- DataObject createDataObject(String propertyName);
-
- /**
- * Returns a new {@link DataObject data object} contained by this object using the specified property,
- * which must be a {@link Property#isContainment containment property}.
- * The type of the created object is the {@link Property#getType declared type} of the specified property.
- * @param propertyIndex the index of the specified containment property.
- * @return the created data object.
- * @see #createDataObject(int, String, String)
- */
- DataObject createDataObject(int propertyIndex);
-
- /**
- * Returns a new {@link DataObject data object} contained by this object using the specified property,
- * which must be a {@link Property#isContainment containment property}.
- * The type of the created object is the {@link Property#getType declared type} of the specified property.
- * @param property the specified containment property.
- * @return the created data object.
- * @see #createDataObject(Property, Type)
- */
- DataObject createDataObject(Property property);
-
- /**
- * Returns a new {@link DataObject data object} contained by this object using the specified property,
- * which must be a {@link Property#isContainment containment property}.
- * The type of the created object is specified by the packageURI and typeName arguments.
- * The specified type must be a compatible target for the property identified by propertyName.
- * @param propertyName the name of the specified containment property.
- * @param namespaceURI the namespace URI of the package containing the type of object to be created.
- * @param typeName the name of a type in the specified package.
- * @return the created data object.
- * @see #createDataObject(String)
- * @see DataGraph#getType
- */
- DataObject createDataObject(String propertyName, String namespaceURI, String typeName);
-
- /**
- * Returns a new {@link DataObject data object} contained by this object using the specified property,
- * which must be a {@link Property#isContainment containment property}.
- * The type of the created object is specified by the packageURI and typeName arguments.
- * The specified type must be a compatible target for the property identified by propertyIndex.
- * @param propertyIndex the index of the specified containment property.
- * @param namespaceURI the namespace URI of the package containing the type of object to be created.
- * @param typeName the name of a type in the specified package.
- * @return the created data object.
- * @see #createDataObject(int)
- * @see DataGraph#getType
- */
- DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName);
-
- /**
- * Returns a new {@link DataObject data object} contained by this object using the specified property,
- * which must be of {@link Property#isContainment containment type}.
- * The type of the created object is specified by the type argument,
- * which must be a compatible target for the speicifed property.
- * @param property a containment property of this object.
- * @param type the type of object to be created.
- * @return the created data object.
- * @see #createDataObject(int)
- */
- DataObject createDataObject(Property property, Type type);
-
- /**
- * Remove this object from its container and then unset all its non-{@link Property#isReadOnly readOnly} Properties.
- * If this object is contained by a {@link Property#isReadOnly readOnly} {@link Property#isContainment containment property}, its non-{@link Property#isReadOnly readOnly} Properties will be unset but the object will not be removed from its container.
- * All DataObjects recursively contained by {@link Property#isContainment containment Properties} will also be deleted.
- */
- void delete();
-
- /**
- * Returns the containing {@link DataObject data object}
- * or
- * The type defines the Properties available for reflective access.
- * @return the type.
- */
- Type getType();
-
- /**
- * Returns the
- * The expression
- *true
) or off (false
).
- * @return true
if change logging is on.
- * @see #beginLogging
- * @see #endLogging
- */
- boolean isLogging();
-
- /**
- * Returns the {@link DataGraph data graph} associated with this change summary or null.
- * @return the data graph.
- * @see DataGraph#getChangeSummary
- */
- DataGraph getDataGraph();
-
- /**
- * Returns a list consisting of all the {@link DataObject data objects} that have been changed while {@link #isLogging logging}.
- * true
if the specified data object was created.
- * @see #getChangedDataObjects
- */
- boolean isCreated(DataObject dataObject);
-
- /**
- * Returns whether or not the specified data object was deleted while {@link #isLogging logging}.
- * Any object that is not in scope but was in scope when logging began
- * will be considered deleted.
- * @param dataObject the data object in question.
- * @return true
if the specified data object was deleted.
- * @see #getChangedDataObjects
- */
- boolean isDeleted(DataObject dataObject);
-
- /**
- * A setting encapsulates a {@link Property property} and a corresponding single value of the property's {@link Property#getType type}.
- */
- public interface Setting
- {
- /**
- * Returns the property of the setting.
- * @return the setting property.
- */
- Property getProperty();
-
- /**
- * Returns the value of the setting.
- * @return the setting value.
- */
- Object getValue();
-
- /**
- * Returns whether or not the property is set.
- * @return true
if the property is set.
- */
- boolean isSet();
- }
-
- /**
- * Returns a list of {@link ChangeSummary.Setting settings}
- * that represent the property values of the given dataObject
- * at the point when logging {@link #beginLogging() began}.
- * true
if the specified data object was modified.
- * @see #getChangedDataObjects
- */
- boolean isModified(DataObject dataObject);
-
- /**
- * Returns the ChangeSummary root DataObject - the object from which
- * changes are tracked.
- * When a DataGraph is used, this is the same as getDataGraph().getRootObject().
- * @return the ChangeSummary root DataObject
- */
- DataObject getRootObject();
-
- /**
- * Returns a {@link ChangeSummary.Setting setting} for the specified property
- * representing the property value of the given dataObject
- * at the point when logging {@link #beginLogging() began}.
- *
- * DataObject company = ...;
- * company.get("name"); is the same as company.get(company.getType().getProperty("name"))
- * company.set("name", "acme");
- * company.get("department.0/name") is the same as ((DataObject)((List)company.get("department")).get(0)).get("name")
- * .n indexes from 0 ... implies the name property of the first department
- * company.get("department[1]/name") [] indexes from 1 ... implies the name property of the first department
- * company.get("department[number=123]") returns the first department where number=123
- * company.get("..") returns the containing data object
- * company.get("/") returns the root containing data object
- *
- * boolean
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the boolean
value of the specified property.
- * @see #get(String)
- */
- boolean getBoolean(String path);
-
- /**
- * Returns the value of a byte
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the byte
value of the specified property.
- * @see #get(String)
- */
- byte getByte(String path);
-
- /**
- * Returns the value of a char
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the char
value of the specified property.
- * @see #get(String)
- */
- char getChar(String path);
-
- /**
- * Returns the value of a double
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the double
value of the specified property.
- * @see #get(String)
- */
- double getDouble(String path);
-
- /**
- * Returns the value of a float
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the float
value of the specified property.
- * @see #get(String)
- */
- float getFloat(String path);
-
- /**
- * Returns the value of a int
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the int
value of the specified property.
- * @see #get(String)
- */
- int getInt(String path);
-
- /**
- * Returns the value of a long
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the long
value of the specified property.
- * @see #get(String)
- */
- long getLong(String path);
-
- /**
- * Returns the value of a short
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the short
value of the specified property.
- * @see #get(String)
- */
- short getShort(String path);
-
- /**
- * Returns the value of a byte[]
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the byte[]
value of the specified property.
- * @see #get(String)
- */
- byte[] getBytes(String path);
-
- /**
- * Returns the value of a BigDecimal
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the BigDecimal
value of the specified property.
- * @see #get(String)
- */
- BigDecimal getBigDecimal(String path);
-
- /**
- * Returns the value of a BigInteger
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the BigInteger
value of the specified property.
- * @see #get(String)
- */
- BigInteger getBigInteger(String path);
-
- /**
- * Returns the value of a DataObject
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the DataObject
value of the specified property.
- * @see #get(String)
- */
- DataObject getDataObject(String path);
-
- /**
- * Returns the value of a Date
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the Date
value of the specified property.
- * @see #get(String)
- */
- Date getDate(String path);
-
- /**
- * Returns the value of a String
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the String
value of the specified property.
- * @see #get(String)
- */
- String getString(String path);
-
- /**
- * Returns the value of a List
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the List
value of the specified property.
- * @see #get(String)
- */
- List getList(String path);
-
- /**
- * Returns the value of a Sequence
property identified by the specified path.
- * @param path the path to a valid object and property.
- * @return the Sequence
value of the specified property.
- * @see #get(String)
- */
- Sequence getSequence(String path);
-
- /**
- * Sets the value of a boolean
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setBoolean(String path, boolean value);
-
- /**
- * Sets the value of a byte
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setByte(String path, byte value);
-
- /**
- * Sets the value of a char
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setChar(String path, char value);
-
- /**
- * Sets the value of a double
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setDouble(String path, double value);
-
- /**
- * Sets the value of a float
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setFloat(String path, float value);
-
- /**
- * Sets the value of a int
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setInt(String path, int value);
-
- /**
- * Sets the value of a long
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setLong(String path, long value);
-
- /**
- * Sets the value of a short
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setShort(String path, short value);
-
- /**
- * Sets the value of a byte[]
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setBytes(String path, byte[] value);
-
- /**
- * Sets the value of a BigDecimal
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setBigDecimal(String path, BigDecimal value);
-
- /**
- * Sets the value of a BigInteger
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setBigInteger(String path, BigInteger value);
-
- /**
- * Sets the value of a DataObject
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setDataObject(String path, DataObject value);
-
- /**
- * Sets the value of a Date
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setDate(String path, Date value);
-
- /**
- * Sets the value of a String
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- */
- void setString(String path, String value);
-
- /**
- * Sets the value of a List
property identified by the specified path, to the specified value.
- * @param path the path to a valid object and property.
- * @param value the new value for the property.
- * @see #set(String, Object)
- * @see #setList(Property, List)
- */
- void setList(String path, List value);
-
- /**
- * Returns the value of the property at the specified index in {@link Type#getProperties property list}
- * of this object's {@link Type type}.
- * @param propertyIndex the index of the property.
- * @return the value of the specified property.
- * @see #get(Property)
- */
- Object get(int propertyIndex);
-
- /**
- * Sets the property at the specified index in {@link Type#getProperties property list} of this object's
- * {@link Type type}, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void set(int propertyIndex, Object value);
-
- /**
- * Returns whether the the property at the specified index in {@link Type#getProperties property list} of this object's
- * {@link Type type}, is considered to be set.
- * @param propertyIndex the index of the property.
- * @return whether the specified property is set.
- * @see #isSet(Property)
- */
- boolean isSet(int propertyIndex);
-
- /**
- * Unsets the property at the specified index in {@link Type#getProperties property list} of this object's {@link Type type}.
- * @param propertyIndex the index of the property.
- * @see #unset(Property)
- */
- void unset(int propertyIndex);
-
- /**
- * Returns the value of a boolean
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the boolean
value of the specified property.
- * @see #get(int)
- */
- boolean getBoolean(int propertyIndex);
-
- /**
- * Returns the value of a byte
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the byte
value of the specified property.
- * @see #get(int)
- */
- byte getByte(int propertyIndex);
-
- /**
- * Returns the value of a char
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the char
value of the specified property.
- * @see #get(int)
- */
- char getChar(int propertyIndex);
-
- /**
- * Returns the value of a double
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the double
value of the specified property.
- * @see #get(int)
- */
- double getDouble(int propertyIndex);
-
- /**
- * Returns the value of a float
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the float
value of the specified property.
- * @see #get(int)
- */
- float getFloat(int propertyIndex);
-
- /**
- * Returns the value of a int
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the int
value of the specified property.
- * @see #get(int)
- */
- int getInt(int propertyIndex);
-
- /**
- * Returns the value of a long
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the long
value of the specified property.
- * @see #get(int)
- */
- long getLong(int propertyIndex);
-
- /**
- * Returns the value of a short
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the short
value of the specified property.
- * @see #get(int)
- */
- short getShort(int propertyIndex);
-
- /**
- * Returns the value of a byte[]
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the byte[]
value of the specified property.
- * @see #get(int)
- */
- byte[] getBytes(int propertyIndex);
-
- /**
- * Returns the value of a BigDecimal
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the BigDecimal
value of the specified property.
- * @see #get(int)
- */
- BigDecimal getBigDecimal(int propertyIndex);
-
- /**
- * Returns the value of a BigInteger
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the BigInteger
value of the specified property.
- * @see #get(int)
- */
- BigInteger getBigInteger(int propertyIndex);
-
- /**
- * Returns the value of a DataObject
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the DataObject
value of the specified property.
- * @see #get(int)
- */
- DataObject getDataObject(int propertyIndex);
-
- /**
- * Returns the value of a Date
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the Date
value of the specified property.
- * @see #get(int)
- */
- Date getDate(int propertyIndex);
-
- /**
- * Returns the value of a String
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the String
value of the specified property.
- * @see #get(int)
- */
- String getString(int propertyIndex);
-
- /**
- * Returns the value of a List
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the List
value of the specified property.
- * @see #get(int)
- */
- List getList(int propertyIndex);
-
- /**
- * Returns the value of a Sequence
property identified by the specified property index.
- * @param propertyIndex the index of the property.
- * @return the Sequence
value of the specified property.
- * @see #get(int)
- */
- Sequence getSequence(int propertyIndex);
-
- /**
- * Sets the value of a boolean
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setBoolean(int propertyIndex, boolean value);
-
- /**
- * Sets the value of a byte
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setByte(int propertyIndex, byte value);
-
- /**
- * Sets the value of a char
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setChar(int propertyIndex, char value);
-
- /**
- * Sets the value of a double
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setDouble(int propertyIndex, double value);
-
- /**
- * Sets the value of a float
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setFloat(int propertyIndex, float value);
-
- /**
- * Sets the value of a int
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setInt(int propertyIndex, int value);
-
- /**
- * Sets the value of a long
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setLong(int propertyIndex, long value);
-
- /**
- * Sets the value of a short
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setShort(int propertyIndex, short value);
-
- /**
- * Sets the value of a byte[]
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setBytes(int propertyIndex, byte[] value);
-
- /**
- * Sets the value of a BigDecimal
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setBigDecimal(int propertyIndex, BigDecimal value);
-
- /**
- * Sets the value of a BigInteger
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setBigInteger(int propertyIndex, BigInteger value);
-
- /**
- * Sets the value of a DataObject
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setDataObject(int propertyIndex, DataObject value);
-
- /**
- * Sets the value of a Date
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setDate(int propertyIndex, Date value);
-
- /**
- * Sets the value of a String
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- */
- void setString(int propertyIndex, String value);
-
- /**
- * Sets the value of a List
property identified by the specified property index, to the specified value.
- * @param propertyIndex the index of the property.
- * @param value the new value for the property.
- * @see #set(int, Object)
- * @see #setList(Property, List)
- */
- void setList(int propertyIndex, List value);
-
- /**
- * Returns the value of the given property of this object.
- * boolean
property.
- * @param property the property to get.
- * @return the boolean
value of the specified property.
- * @see #get(Property)
- */
- boolean getBoolean(Property property);
-
- /**
- * Returns the value of the specified byte
property.
- * @param property the property to get.
- * @return the byte
value of the specified property.
- * @see #get(Property)
- */
- byte getByte(Property property);
-
- /**
- * Returns the value of the specified char
property.
- * @param property the property to get.
- * @return the char
value of the specified property.
- * @see #get(Property)
- */
- char getChar(Property property);
-
- /**
- * Returns the value of the specified double
property.
- * @param property the property to get.
- * @return the double
value of the specified property.
- * @see #get(Property)
- */
- double getDouble(Property property);
-
- /**
- * Returns the value of the specified float
property.
- * @param property the property to get.
- * @return the float
value of the specified property.
- * @see #get(Property)
- */
- float getFloat(Property property);
-
- /**
- * Returns the value of the specified int
property.
- * @param property the property to get.
- * @return the int
value of the specified property.
- * @see #get(Property)
- */
- int getInt(Property property);
-
- /**
- * Returns the value of the specified long
property.
- * @param property the property to get.
- * @return the long
value of the specified property.
- * @see #get(Property)
- */
- long getLong(Property property);
-
- /**
- * Returns the value of the specified short
property.
- * @param property the property to get.
- * @return the short
value of the specified property.
- * @see #get(Property)
- */
- short getShort(Property property);
-
- /**
- * Returns the value of the specified byte[]
property.
- * @param property the property to get.
- * @return the byte[]
value of the specified property.
- * @see #get(Property)
- */
- byte[] getBytes(Property property);
-
- /**
- * Returns the value of the specified BigDecimal
property.
- * @param property the property to get.
- * @return the BigDecimal
value of the specified property.
- * @see #get(Property)
- */
- BigDecimal getBigDecimal(Property property);
-
- /**
- * Returns the value of the specified BigInteger
property.
- * @param property the property to get.
- * @return the BigInteger
value of the specified property.
- * @see #get(Property)
- */
- BigInteger getBigInteger(Property property);
-
- /**
- * Returns the value of the specified DataObject
property.
- * @param property the property to get.
- * @return the DataObject
value of the specified property.
- * @see #get(Property)
- */
- DataObject getDataObject(Property property);
-
- /**
- * Returns the value of the specified Date
property.
- * @param property the property to get.
- * @return the Date
value of the specified property.
- * @see #get(Property)
- */
- Date getDate(Property property);
-
- /**
- * Returns the value of the specified String
property.
- * @param property the property to get.
- * @return the String
value of the specified property.
- * @see #get(Property)
- */
- String getString(Property property);
-
- /**
- * Returns the value of the specified List
property.
- * The List returned contains the current values.
- * Updates through the List interface operate on the current values of the DataObject.
- * Each access returns the same List object.
- * @param property the property to get.
- * @return the List
value of the specified property.
- * @see #get(Property)
- */
- List getList(Property property);
-
- /**
- * Returns the value of the specified Sequence
property.
- * @param property the property to get.
- * @return the Sequence
value of the specified property.
- * @see #get(Property)
- */
- Sequence getSequence(Property property);
-
- /**
- * Sets the value of the specified boolean
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setBoolean(Property property, boolean value);
-
- /**
- * Sets the value of the specified byte
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setByte(Property property, byte value);
-
- /**
- * Sets the value of the specified char
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setChar(Property property, char value);
-
- /**
- * Sets the value of the specified double
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setDouble(Property property, double value);
-
- /**
- * Sets the value of the specified float
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setFloat(Property property, float value);
-
- /**
- * Sets the value of the specified int
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setInt(Property property, int value);
-
- /**
- * Sets the value of the specified long
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setLong(Property property, long value);
-
- /**
- * Sets the value of the specified short
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setShort(Property property, short value);
-
- /**
- * Sets the value of the specified byte[]
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setBytes(Property property, byte[] value);
-
- /**
- * Sets the value of the specified BigDecimal
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setBigDecimal(Property property, BigDecimal value);
-
- /**
- * Sets the value of the specified BigInteger
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setBigInteger(Property property, BigInteger value);
-
- /**
- * Sets the value of the specified DataObject
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setDataObject(Property property, DataObject value);
-
- /**
- * Sets the value of the specified Date
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setDate(Property property, Date value);
-
- /**
- * Sets the value of the specified String
property, to the specified value.
- * @param property the property to set.
- * @param value the new value for the property.
- * @see #set(Property, Object)
- */
- void setString(Property property, String value);
-
- /**
- * Sets the value of the specified List
property, to the specified value.
- * null
if there is no container.
- * @return the containing data object or null
.
- */
- DataObject getContainer();
-
- /**
- * Return the Property of the {@link DataObject data object} containing this data object
- * or null
if there is no container.
- * @return the property containing this data object.
- */
- Property getContainmentProperty();
-
- /**
- * Returns the {@link DataGraph data graph} for this object or null
if there isn't one.
- * @return the containing data graph or null
.
- */
- DataGraph getDataGraph();
-
- /**
- * Returns the data object's type.
- * Sequence
for this DataObject.
- * When getType().isSequencedType() == true,
- * the Sequence of a DataObject corresponds to the
- * XML elements representing the values of its Properties.
- * Updates through DataObject and the Lists or Sequences returned
- * from DataObject operate on the same data.
- * When getType().isSequencedType() == false, null is returned.
- * @return the Sequence
or null.
- */
- Sequence getSequence();
-
- /**
- * Returns a read-only List of the Properties currently used in this DataObject.
- * This list will contain all of the Properties in getType().getProperties()
- * and any Properties where isSet(property) is true.
- * For example, Properties resulting from the use of
- * open or mixed XML content are present if allowed by the Type.
- * the List does not contain duplicates.
- * The order of the Properties in the List begins with getType().getProperties()
- * and the order of the remaining Properties is determined by the implementation.
- * The same list will be returned unless the DataObject is updated so that
- * the contents of the List change.
- * @return the List of Properties currently used in this DataObject.
- */
- List /* Property */ getInstanceProperties();
-
- /**
- * Returns the named Property from the current instance properties,
- * or null if not found. The instance properties are getInstanceProperties().
- * @param propertyName the name of the Property
- * @return the named Property from the DataObject's current instance properties, or null.
- */
- Property getProperty(String propertyName);
-
- /**
- * Returns the root {@link DataObject data object}.
- * @return the root data object.
- */
- DataObject getRootObject();
-
- /**
- * Returns the ChangeSummary with scope covering this dataObject, or null
- * if there is no ChangeSummary.
- * @return the ChangeSummary with scope covering this dataObject, or null.
- */
- ChangeSummary getChangeSummary();
-
- /**
- * Removes this DataObject from its container, if any.
- * Same as
- * getContainer().getList(getContainmentProperty()).remove(this) or
- * getContainer().unset(getContainmentProperty())
- * depending on getContainmentProperty().isMany() respectively.
- */
- void detach();
-}
diff --git a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Property.java b/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Property.java
deleted file mode 100644
index cc96e90b44..0000000000
--- a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Property.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * true
if the Property is many-valued.
- */
- boolean isMany();
-
- /**
- * Returns whether the Property is containment, i.e., whether it represents by-value composition.
- * @return true
if the Property is containment.
- */
- boolean isContainment();
-
- /**
- * Returns the containing type of this Property.
- * @return the Property's containing type.
- * @see Type#getProperties()
- */
- Type getContainingType();
-
- /**
- * Returns the default value this Property will have in a {@link DataObject data object} where the Property hasn't been set.
- * @return the default value.
- */
- Object getDefault();
-
- /**
- * Returns true if values for this Property cannot be modified using the SDO APIs.
- * When true, DataObject.set(Property property, Object value) throws an exception.
- * Values may change due to other factors, such as services operating on DataObjects.
- * @return true if values for this Property cannot be modified.
- */
- boolean isReadOnly();
-
- /**
- * Returns the opposite Property if the Property is bi-directional or null otherwise.
- * @return the opposite Property if the Property is bi-directional or null
- */
- Property getOpposite();
-
- /**
- * Return a list of alias names for this Property.
- * @return a list of alias names for this Property.
- */
- List /*String*/ getAliasNames();
-}
diff --git a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Sequence.java b/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Sequence.java
deleted file mode 100644
index b46a5be7e0..0000000000
--- a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Sequence.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * null
for mixed text entries.
- * @param index the index of the entry.
- * @return the property or null
for the given entry index.
- */
- Property getProperty(int index);
-
- /**
- * Returns the property value for the given entry index.
- * @param index the index of the entry.
- * @return the value for the given entry index.
- */
- Object getValue(int index);
-
- /**
- * Sets the entry at a specified index to the new value.
- * @param index the index of the entry.
- * @param value the new value for the entry.
- */
- Object setValue(int index, Object value);
-
- /**
- * Adds a new entry with the specified property name and value
- * to the end of the entries.
- * @param propertyName the name of the entry's property.
- * @param value the value for the entry.
- */
- boolean add(String propertyName, Object value);
-
- /**
- * Adds a new entry with the specified property index and value
- * to the end of the entries.
- * @param propertyIndex the index of the entry's property.
- * @param value the value for the entry.
- */
- boolean add(int propertyIndex, Object value);
-
- /**
- * Adds a new entry with the specified property and value
- * to the end of the entries.
- * @param property the property of the entry.
- * @param value the value for the entry.
- */
- boolean add(Property property, Object value);
-
- /**
- * Adds a new entry with the specified property name and value
- * at the specified entry index.
- * @param index the index at which to add the entry.
- * @param propertyName the name of the entry's property.
- * @param value the value for the entry.
- */
- void add(int index, String propertyName, Object value);
-
- /**
- * Adds a new entry with the specified property index and value
- * at the specified entry index.
- * @param index the index at which to add the entry.
- * @param propertyIndex the index of the entry's property.
- * @param value the value for the entry.
- */
- void add(int index, int propertyIndex, Object value);
-
- /**
- * Adds a new entry with the specified property and value
- * at the specified entry index.
- * @param index the index at which to add the entry.
- * @param property the property of the entry.
- * @param value the value for the entry.
- */
- void add(int index, Property property, Object value);
-
- /**
- * Removes the entry at the given entry index.
- * @param index the index of the entry.
- */
- void remove(int index);
-
- /**
- * Moves the entry at fromIndex
to toIndex
.
- * @param toIndex the index of the entry destination.
- * @param fromIndex the index of the entry to move.
- */
- void move(int toIndex, int fromIndex);
-
- /**
- * Adds a new entry with the SDO text Property
- * to the end of the Sequence.
- * Same as add(property, text) where property is the SDO text Property.
- * @param text value of the entry.
- */
- void add(String text);
-
- /**
- * Adds a new entry with the SDO text Property
- * at the given index.
- * Same as add(index, property, text) where property is the SDO text Property.
- * @param index the index at which to add the entry.
- * @param text value of the entry.
- */
- void add(int index, String text);
-
-}
diff --git a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Type.java b/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Type.java
deleted file mode 100644
index 85d43aad60..0000000000
--- a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/Type.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * true
if the object is an instance.
- * @see Class#isInstance
- */
- boolean isInstance(Object object);
-
- /**
- * Returns the List of the {@link Property Properties} of this type.
- *
- * type.getProperties().indexOf(property)
- *
- * yields the property's index relative to this type.
- * As such, these expressions are equivalent:
- *
- * dataObject.{@link DataObject#get(int) get}(i)
- * dataObject.{@link DataObject#get(Property) get}((Property)dataObject.getType().getProperties().get(i));
- *
- *
- * dataObject.{@link DataObject#get(String) get}("name") - * dataObject.{@link DataObject#get(Property) get}(dataObject.getType().getProperty("name")) - *- * - * @return the Property with the specified name. - * @see #getProperties - */ - Property getProperty(String propertyName); - - /** - * Indicates if this Type specifies DataTypes (true) or DataObjects (false). - * When false, any object that is an instance of this type - * also implements the DataObject interface. - * True for simple types such as Strings and numbers. - * For any object: - *
- * isInstance(object) && !isDataType() implies - * DataObject.class.isInstance(object) returns true. - *- * @return true if Type specifies DataTypes, false for DataObjects. - */ - boolean isDataType(); - - /** - * Indicates if this Type allows any form of open content. If false, - * dataObject.getInstanceProperties() must be the same as - * dataObject.getType().getProperties() for any DataObject dataObject of this Type. - * @return true if this Type allows open content. - */ - boolean isOpen(); - - /** - * Indicates if this Type specifies Sequenced DataObjects. - * Sequenced DataObjects are used when the order of values - * between Properties must be preserved. - * When true, a DataObject will return a Sequence. For example, - *
- * Sequence elements = dataObject.{@link DataObject#getSequence() getSequence}(); - *- * @return true if this Type specifies Sequenced DataObjects. - */ - boolean isSequenced(); - - /** - * Indicates if this Type is abstract. If true, this Type cannot be - * instantiated. Abstract types cannot be used in DataObject or - * DataFactory create methods. - * @return true if this Type is abstract. - */ - boolean isAbstract(); - - /** - * Returns the List of base Types for this Type. The List is empty - * if there are no base Types. XSD
Two DataObjects are equalShallow if
- * they have the same {@link DataObject#getType Type}
- * and all their compared Properties are equal.
- * The set of Properties compared are the
- * {@link DataObject#getInstanceProperties() instance properties}
- * where property.getType().isDataType() is true
- * and property.getType() is not ChangeSummaryType.
- *
Two of these Property values are equal if they are both not
- * {@link DataObject#isSet(Property) set}, or set to an equal value
- * dataObject1.get(property).equals(dataObject2.get(property))
- *
If the type is a sequenced type, the sequence entries must be the same.
- * For each entry x in the sequence where the property is used in the comparison,
- * dataObject1.getSequence().getValue(x).equals(
- * dataObject2.getSequence().getValue(x)) and
- * dataObject1.getSequence().getProperty(x) ==
- * dataObject2.getSequence().getProperty(x)
- * must be true.
- *
Two DataObjects are equal(Deep) if they are equalShallow,
- * all their compared Properties are equal, and all reachable DataObjects in their
- * graphs excluding containers are equal.
- * The set of Properties compared are the
- * {@link DataObject#getInstanceProperties() instance properties}
- * where property.getType().isDataType() is false,
- * and is not a container property, ie !property.getOpposite().isContainment()
- *
Two of these Property values are equal if they are both not
- * {@link DataObject#isSet(Property) set}, or all the DataObjects
- * they refer to are {@link #equal(DataObject, DataObject) equal} in the
- * context of dataObject1 and dataObject2.
- *
Note that properties to a containing DataObject are not compared
- * which means two DataObject trees can be equal even if their containers are not equal.
- *
If the type is a sequenced type, the sequence entries must be the same.
- * For each entry x in the sequence where the property is used in the comparison,
- * equal(dataObject1.getSequence().getValue(x),
- * dataObject2.getSequence().getValue(x)) and
- * dataObject1.getSequence().getProperty(x) ==
- * dataObject2.getSequence().getProperty(x)
- * must be true.
- *
- * A DataObject directly or indirectly referenced by dataObject1 or dataObject2 - * can only be equal to exactly one DataObject directly or indirectly referenced - * by dataObject1 or dataObject2, respectively. - * This ensures that dataObject1 and dataObject2 are equal if the graph formed by - * all their referenced DataObjects have the same shape. - *
- * Returns true if the trees of DataObjects are equal(Deep). - * @param dataObject1 DataObject to be compared - * @param dataObject2 DataObject to be compared - * @return true if the trees of DataObjects are equal(Deep). - */ - boolean equal(DataObject dataObject1, DataObject dataObject2); - - /** - * The default EqualityHelper. - */ - EqualityHelper INSTANCE = HelperProvider.getEqualityHelper(); -} diff --git a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/helper/TypeHelper.java b/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/helper/TypeHelper.java deleted file mode 100644 index 13f013ed50..0000000000 --- a/branches/java-post-M1/spec/sdo/src/main/java/commonj/sdo/helper/TypeHelper.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - *