xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daver...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2 Cur.java DomImpl.java Saaj.java
Date Fri, 16 Apr 2004 22:34:49 GMT
daveremy    2004/04/16 15:34:49

  Modified:    v2/src/newstore2/org/apache/xmlbeans/impl/newstore2 Cur.java
                        DomImpl.java Saaj.java
  Log:
  changes to delegate comment handling back to saaj, couple of other minor things
  
  Revision  Changes    Path
  1.32      +40 -34    xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Cur.java
  
  Index: Cur.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Cur.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Cur.java	12 Apr 2004 20:55:13 -0000	1.31
  +++ Cur.java	16 Apr 2004 22:34:49 -0000	1.32
  @@ -269,7 +269,8 @@
       
       static Xobj createCommentXobj ( Locale l )
       {
  -        return l._saaj == null ? new CommentXobj( l ) : new SaajCommentXobj( l );
  +//        return l._saaj == null ? new CommentXobj( l ) : new SaajCommentXobj( l );
  +        return new CommentXobj( l );
       }
   
       //
  @@ -1432,13 +1433,13 @@
               else
                   to.insertChars( _xobj._srcAfter, _xobj._offAfter + _pos - pa, cchMove );
           }
  -
  +
           notifyTextChange();
           
           for ( Cur e = _xobj.getEmbedded() ; e != null ; e = e._next )
               if (e != this && inChars( e, cchMove ))
                   e.moveTo( to._xobj, to._pos + e._pos - _pos );
  -
  +
           Object srcMoved;
           int    offMoved;
           
  @@ -1844,7 +1845,7 @@
               else
               {
                   x = x.ensureParent();
  -                p = END_POS;
  +                p = x.posAfter() - 1;
               }
           }
           else if (p == END_POS)
  @@ -2379,6 +2380,9 @@
           {
               int cchRight = cchRight( pos );
   
  +            if (cchRight == 0)
  +                return "";
  +
               if (cch < 0 || cch > cchRight)
                   cch = cchRight;
   
  @@ -2386,7 +2390,9 @@
   
               // TODO - save this string back into the xobj for use later
               // TODO - save this string back into the xobj for use later
  -            
  +
  +            assert pos > 0;
  +
               if (pos >= pa)
                   return CharUtil.getString( _srcAfter, _offAfter + pos - pa, cch );
               else
  @@ -3212,35 +3218,35 @@
           DetailEntryXobj ( Locale l, QName name ) { super( l, name ); }
       }
   
  -    private static class SaajCommentXobj extends CommentXobj implements javax.xml.soap.Text
  -    {
  -        SaajCommentXobj ( Locale l ) { super( l ); }
  -
  -        Xobj newNode ( ) { return new SaajCommentXobj( _locale ); }
  -        
  -        public Text splitText ( int offset ) { throw new IllegalStateException(); }
  -        public String getWholeText ( ) { throw new IllegalStateException(); }
  -        public boolean isElementContentWhitespace ( ) { throw new IllegalStateException();
}
  -        public Text replaceWholeText ( String content ) { throw new IllegalStateException();
}
  -
  -        public boolean isComment ( ) { return true; }
  -        
  -        public void detachNode ( ) { DomImpl._soapNode_detachNode( this ); }
  -        public void recycleNode ( ) { DomImpl._soapNode_recycleNode( this ); }
  -        public String getValue ( ) { return DomImpl._soapNode_getValue( this ); }
  -        public void setValue ( String value ) { DomImpl._soapNode_setValue( this, value
); }
  -        public SOAPElement getParentElement ( ) { return DomImpl._soapNode_getParentElement(
this ); }
  -        public void setParentElement ( SOAPElement p ) { DomImpl._soapNode_setParentElement(
this, p ); }
  -        
  -        public void appendData ( String arg ) { DomImpl._characterData_appendData( this,
arg ); }
  -        public void deleteData ( int offset, int count ) { DomImpl._characterData_deleteData(
this, offset, count ); }
  -        public String getData ( ) { return DomImpl._characterData_getData( this ); }
  -        public int getLength ( ) { return DomImpl._characterData_getLength( this ); }
  -        public void insertData ( int offset, String arg ) { DomImpl._characterData_insertData(
this, offset, arg ); }
  -        public void replaceData ( int offset, int count, String arg ) { DomImpl._characterData_replaceData(
this, offset, count, arg ); }
  -        public void setData ( String data ) { DomImpl._characterData_setData( this, data
); }
  -        public String substringData ( int offset, int count ) { return DomImpl._characterData_substringData(
this, offset, count ); }
  -    }
  +//    private static class SaajCommentXobj extends CommentXobj implements javax.xml.soap.Text
  +//    {
  +//        SaajCommentXobj ( Locale l ) { super( l ); }
  +//
  +//        Xobj newNode ( ) { return new SaajCommentXobj( _locale ); }
  +//
  +//        public Text splitText ( int offset ) { throw new IllegalStateException(); }
  +//        public String getWholeText ( ) { throw new IllegalStateException(); }
  +//        public boolean isElementContentWhitespace ( ) { throw new IllegalStateException();
}
  +//        public Text replaceWholeText ( String content ) { throw new IllegalStateException();
}
  +//
  +//        public boolean isComment ( ) { DomImpl._soapText_isComment( this ); }
  +//
  +//        public void detachNode ( ) { DomImpl._soapNode_detachNode( this ); }
  +//        public void recycleNode ( ) { DomImpl._soapNode_recycleNode( this ); }
  +//        public String getValue ( ) { return DomImpl._soapNode_getValue( this ); }
  +//        public void setValue ( String value ) { DomImpl._soapNode_setValue( this, value
); }
  +//        public SOAPElement getParentElement ( ) { return DomImpl._soapNode_getParentElement(
this ); }
  +//        public void setParentElement ( SOAPElement p ) { DomImpl._soapNode_setParentElement(
this, p ); }
  +//
  +//        public void appendData ( String arg ) { DomImpl._characterData_appendData( this,
arg ); }
  +//        public void deleteData ( int offset, int count ) { DomImpl._characterData_deleteData(
this, offset, count ); }
  +//        public String getData ( ) { return DomImpl._characterData_getData( this ); }
  +//        public int getLength ( ) { return DomImpl._characterData_getLength( this ); }
  +//        public void insertData ( int offset, String arg ) { DomImpl._characterData_insertData(
this, offset, arg ); }
  +//        public void replaceData ( int offset, int count, String arg ) { DomImpl._characterData_replaceData(
this, offset, count, arg ); }
  +//        public void setData ( String data ) { DomImpl._characterData_setData( this, data
); }
  +//        public String substringData ( int offset, int count ) { return DomImpl._characterData_substringData(
this, offset, count ); }
  +//    }
   
       //
       //
  
  
  
  1.31      +16 -3     xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/DomImpl.java
  
  Index: DomImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/DomImpl.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- DomImpl.java	12 Apr 2004 20:55:13 -0000	1.30
  +++ DomImpl.java	16 Apr 2004 22:34:49 -0000	1.31
  @@ -392,7 +392,6 @@
       private static void removeNode ( Dom n )
       {
           assert n.nodeType() != TEXT && n.nodeType() != CDATA;
  -        assert parent( n ) != null;
           
           Cur cTo = n.tempCur();
           Cur cFrom = n.tempCur();
  @@ -3823,7 +3822,7 @@
               super( l );
           }
   
  -        public boolean isComment ( ) { return false; }
  +        public boolean isComment ( ) { return DomImpl._soapText_isComment( this ); }
           
           public void detachNode ( ) { DomImpl._soapNode_detachNode( this ); }
           public void recycleNode ( ) { DomImpl._soapNode_recycleNode( this ); }
  @@ -3840,7 +3839,7 @@
               super( l );
           }
   
  -        public boolean isComment ( ) { return false; }
  +        public boolean isComment ( ) { return DomImpl._soapText_isComment( this ); }
           
           public void detachNode ( ) { DomImpl._soapNode_detachNode( this ); }
           public void recycleNode ( ) { DomImpl._soapNode_recycleNode( this ); }
  @@ -3848,6 +3847,20 @@
           public void setValue ( String value ) { DomImpl._soapNode_setValue( this, value
); }
           public SOAPElement getParentElement ( ) { return DomImpl._soapNode_getParentElement(
this ); }
           public void setParentElement ( SOAPElement p ) { DomImpl._soapNode_setParentElement(
this, p ); }
  +    }
  +
  +    //
  +    // Soap Text Node
  +    //
  +
  +    public static boolean _soapText_isComment ( Dom n )
  +    {
  +        Locale l = n.locale();
  +
  +        javax.xml.soap.Text text = (javax.xml.soap.Text) n;
  +
  +        if (l.noSync())         { l.enter(); try { return l._saaj.soapText_isComment( text
); } finally { l.exit(); } }
  +        else synchronized ( l ) { l.enter(); try { return l._saaj.soapText_isComment( text
); } finally { l.exit(); } }
       }
       
       //
  
  
  
  1.2       +2 -0      xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Saaj.java
  
  Index: Saaj.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Saaj.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Saaj.java	13 Feb 2004 22:51:24 -0000	1.1
  +++ Saaj.java	16 Apr 2004 22:34:49 -0000	1.2
  @@ -139,6 +139,8 @@
       void    soapHeaderElement_setActor          ( SOAPHeaderElement soapHeaderElement,
String actor );
       String  soapHeaderElement_getActor          ( SOAPHeaderElement soapHeaderElement );
   
  +    boolean soapText_isComment (javax.xml.soap.Text text );
  +
       DetailEntry detail_addDetailEntry   ( Detail detail, Name name );
       Iterator    detail_getDetailEntries ( Detail detail );
   }
  
  
  

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


Mime
View raw message