cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r471503 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne: map/EntityDescriptor.java property/BeanAccessor.java property/Property.java property/PropertyAccessException.java
Date Sun, 05 Nov 2006 19:37:35 GMT
Author: aadamchik
Date: Sun Nov  5 11:37:34 2006
New Revision: 471503

URL: http://svn.apache.org/viewvc?view=rev&rev=471503
Log:
CAY-701: property" package refactoring
(splitting Property and PropertyAccessor interfaces out of the inheritance hierarchy)

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityDescriptor.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/BeanAccessor.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/Property.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/PropertyAccessException.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityDescriptor.java?view=diff&rev=471503&r1=471502&r2=471503
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityDescriptor.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/EntityDescriptor.java
Sun Nov  5 11:37:34 2006
@@ -204,7 +204,7 @@
                     public boolean isFault(Object target) {
                         return false;
                     }
-                    
+
                     public void invalidate(Object object) {
                     }
                 };
@@ -232,7 +232,7 @@
                     + "' of class '"
                     + objectClass.getName()
                     + "', reason: "
-                    + th.getMessage(), null, null, th);
+                    + th.getMessage(), th);
         }
     }
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/BeanAccessor.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/BeanAccessor.java?view=diff&rev=471503&r1=471502&r2=471503
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/BeanAccessor.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/BeanAccessor.java
Sun Nov  5 11:37:34 2006
@@ -59,7 +59,7 @@
         catch (IntrospectionException e) {
             throw new PropertyAccessException(
                     "Invalid bean property: " + propertyName,
-                    null,
+                    this,
                     e);
         }
     }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/Property.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/Property.java?view=diff&rev=471503&r1=471502&r2=471503
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/Property.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/Property.java
Sun Nov  5 11:37:34 2006
@@ -26,12 +26,29 @@
  * @since 1.2
  * @author Andrus Adamchik
  */
-public interface Property extends PropertyAccessor {
+public interface Property {
+
+    /**
+     * Returns property name.
+     */
+    String getName();
+
+    /**
+     * Returns a property value of an object without disturbing the object fault status.
+     */
+    Object readPropertyDirectly(Object object) throws PropertyAccessException;
 
     /**
      * Returns a property value, resolving object fault if needed.
      */
     Object readProperty(Object object) throws PropertyAccessException;
+
+    /**
+     * Sets a property value of an object without disturbing the object fault status. Old
+     * value of the property is specified as a hint.
+     */
+    void writePropertyDirectly(Object object, Object oldValue, Object newValue)
+            throws PropertyAccessException;
 
     /**
      * Sets a property value,resolving object fault if needed. Old value of the property

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/PropertyAccessException.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/PropertyAccessException.java?view=diff&rev=471503&r1=471502&r2=471503
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/PropertyAccessException.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/property/PropertyAccessException.java
Sun Nov  5 11:37:34 2006
@@ -22,16 +22,32 @@
 import org.apache.cayenne.CayenneRuntimeException;
 
 /**
- * An unchecked exception thrown on errors during property access.
+ * An unchecked exception thrown on errors during property access, either within a
+ * PropertyAccessor or a Property.
  * 
  * @since 1.2
  * @author Andrus Adamchik
  */
 public class PropertyAccessException extends CayenneRuntimeException {
 
+    protected Property property;
     protected PropertyAccessor accessor;
     protected Object source;
 
+    /**
+     * @since 3.0
+     */
+    public PropertyAccessException(String message) {
+        this(message, null);
+    }
+
+    /**
+     * @since 3.0
+     */
+    public PropertyAccessException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
     public PropertyAccessException(String message, PropertyAccessor accessor,
             Object source) {
         this(message, accessor, source, null);
@@ -46,10 +62,35 @@
     }
 
     /**
+     * @since 3.0
+     */
+    public PropertyAccessException(String message, Property property, Object source) {
+        this(message, property, source, null);
+    }
+
+    /**
+     * @since 3.0
+     */
+    public PropertyAccessException(String message, Property property, Object source,
+            Throwable cause) {
+        super(message, cause);
+
+        this.property = property;
+        this.source = source;
+    }
+
+    /**
      * Returns property descriptor that was used to access the property. It may be null.
      */
     public PropertyAccessor getAccessor() {
         return accessor;
+    }
+
+    /**
+     * @since 3.0
+     */
+    public Property getProperty() {
+        return property;
     }
 
     /**



Mime
View raw message