You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by kk...@apache.org on 2004/11/11 23:15:49 UTC

cvs commit: xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans DelegateXmlObject.java FilterXmlObject.java

kkrouse     2004/11/11 14:15:49

  Modified:    v1/src/typeimpl/org/apache/xmlbeans/impl/values
                        XmlObjectBase.java
               v1/src/xmlpublic/org/apache/xmlbeans FilterXmlObject.java
               v2/src/typeimpl/org/apache/xmlbeans/impl/values
                        XmlObjectBase.java
               v2/src/xmlpublic/org/apache/xmlbeans FilterXmlObject.java
  Added:       v1/src/xmlpublic/org/apache/xmlbeans DelegateXmlObject.java
               v2/src/xmlpublic/org/apache/xmlbeans DelegateXmlObject.java
  Log:
  Moving ..underlyingXmlObject() method from FilterXmlObject abstract class to
  DeletageXmlObject interface.
  
  DRTs passed
  
  Revision  Changes    Path
  1.8       +4 -3      xml-xmlbeans/v1/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java
  
  Index: XmlObjectBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v1/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XmlObjectBase.java	12 Feb 2004 20:05:57 -0000	1.7
  +++ XmlObjectBase.java	11 Nov 2004 22:15:49 -0000	1.8
  @@ -72,6 +72,7 @@
   import org.apache.xmlbeans.XmlError;
   import org.apache.xmlbeans.SchemaLocalAttribute;
   import org.apache.xmlbeans.FilterXmlObject;
  +import org.apache.xmlbeans.DelegateXmlObject;
   
   import org.w3c.dom.Node;
   
  @@ -97,11 +98,11 @@
               return null;
           if (obj instanceof XmlObjectBase)
               return (XmlObjectBase)obj;
  -        while (obj instanceof FilterXmlObject)
  -            obj = ((FilterXmlObject)obj).underlyingXmlObject();
  +        while (obj instanceof DelegateXmlObject)
  +            obj = ((DelegateXmlObject)obj).underlyingXmlObject();
           if (obj instanceof XmlObjectBase)
               return (XmlObjectBase)obj;
  -        throw new IllegalStateException("Non-native implementations of XmlObject should extend FilterXmlObject");
  +        throw new IllegalStateException("Non-native implementations of XmlObject should extend FilterXmlObject or implement DelegateXmlObject");
       }
   
       public final XmlObject copy()
  
  
  
  1.6       +2 -12     xml-xmlbeans/v1/src/xmlpublic/org/apache/xmlbeans/FilterXmlObject.java
  
  Index: FilterXmlObject.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v1/src/xmlpublic/org/apache/xmlbeans/FilterXmlObject.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FilterXmlObject.java	12 Feb 2004 20:06:01 -0000	1.5
  +++ FilterXmlObject.java	11 Nov 2004 22:15:49 -0000	1.6
  @@ -45,22 +45,12 @@
    * further override some of these methods and may also provide additional
    * methods and fields.
    * <p>
  - * Note: it is important that FilterXmlOBject has no storage (i.e., no
  + * Note: it is important that FilterXmlObject has no storage (i.e., no
    * non-transient fields), because subclasses may be serializable and
    * adding storage would break the serialization format.
    */ 
  -public abstract class FilterXmlObject implements XmlObject, SimpleValue
  +public abstract class FilterXmlObject implements XmlObject, SimpleValue, DelegateXmlObject
   {
  -    /**
  -     * This abstract method is called to obtain the underlying XmlObject.
  -     * Override this method to supply or compute the wrapped object.
  -     * <p>
  -     * Every other method of this class delegates to the object returned
  -     * from this method. It is assumed that the object implements all the
  -     * methods of both XmlObject and SimpleValue.
  -     */ 
  -    public abstract XmlObject underlyingXmlObject();
  -
       public SchemaType schemaType()
       {
           return underlyingXmlObject().schemaType();
  
  
  
  1.1                  xml-xmlbeans/v1/src/xmlpublic/org/apache/xmlbeans/DelegateXmlObject.java
  
  Index: DelegateXmlObject.java
  ===================================================================
  package org.apache.xmlbeans;
  
  /**
   * See {@link FilterXmlObject}
   */
  public interface DelegateXmlObject
  {
      /**
       * This method is called to obtain the underlying XmlObject.
       * Implement this method to supply or compute the wrapped object.
       */
      XmlObject underlyingXmlObject();
  }
  
  
  
  1.19      +4 -3      xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java
  
  Index: XmlObjectBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- XmlObjectBase.java	9 Oct 2004 17:30:16 -0000	1.18
  +++ XmlObjectBase.java	11 Nov 2004 22:15:49 -0000	1.19
  @@ -76,6 +76,7 @@
   import org.apache.xmlbeans.XmlError;
   import org.apache.xmlbeans.SchemaLocalAttribute;
   import org.apache.xmlbeans.FilterXmlObject;
  +import org.apache.xmlbeans.DelegateXmlObject;
   
   import org.w3c.dom.Node;
   
  @@ -101,11 +102,11 @@
               return null;
           if (obj instanceof XmlObjectBase)
               return (XmlObjectBase)obj;
  -        while (obj instanceof FilterXmlObject)
  -            obj = ((FilterXmlObject)obj).underlyingXmlObject();
  +        while (obj instanceof DelegateXmlObject)
  +            obj = ((DelegateXmlObject)obj).underlyingXmlObject();
           if (obj instanceof XmlObjectBase)
               return (XmlObjectBase)obj;
  -        throw new IllegalStateException("Non-native implementations of XmlObject should extend FilterXmlObject");
  +        throw new IllegalStateException("Non-native implementations of XmlObject should extend FilterXmlObject or implement DelegateXmlObject");
       }
   
       public final XmlObject copy()
  
  
  
  1.7       +2 -12     xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/FilterXmlObject.java
  
  Index: FilterXmlObject.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/FilterXmlObject.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FilterXmlObject.java	24 Mar 2004 00:04:23 -0000	1.6
  +++ FilterXmlObject.java	11 Nov 2004 22:15:49 -0000	1.7
  @@ -46,22 +46,12 @@
    * further override some of these methods and may also provide additional
    * methods and fields.
    * <p>
  - * Note: it is important that FilterXmlOBject has no storage (i.e., no
  + * Note: it is important that FilterXmlObject has no storage (i.e., no
    * non-transient fields), because subclasses may be serializable and
    * adding storage would break the serialization format.
    */ 
  -public abstract class FilterXmlObject implements XmlObject, SimpleValue
  +public abstract class FilterXmlObject implements XmlObject, SimpleValue, DelegateXmlObject
   {
  -    /**
  -     * This abstract method is called to obtain the underlying XmlObject.
  -     * Override this method to supply or compute the wrapped object.
  -     * <p>
  -     * Every other method of this class delegates to the object returned
  -     * from this method. It is assumed that the object implements all the
  -     * methods of both XmlObject and SimpleValue.
  -     */ 
  -    public abstract XmlObject underlyingXmlObject();
  -
       public SchemaType schemaType()
       {
           return underlyingXmlObject().schemaType();
  
  
  
  1.1                  xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/DelegateXmlObject.java
  
  Index: DelegateXmlObject.java
  ===================================================================
  package org.apache.xmlbeans;
  
  /**
   * See {@link FilterXmlObject}
   */
  public interface DelegateXmlObject
  {
      /**
       * This method is called to obtain the underlying XmlObject.
       * Implement this method to supply or compute the wrapped object.
       */
      XmlObject underlyingXmlObject();
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org