polx        2005/01/12 00:58:45

  Modified:    jelly/src/java/org/apache/commons/jelly XMLOutput.java
  Log:
  Now uses the parent DocumentListener for objectData if that parent is an
  XMLOutput.
  paul
  
  Revision  Changes    Path
  1.21      +22 -19    
jakarta-commons/jelly/src/java/org/apache/commons/jelly/XMLOutput.java
  
  Index: XMLOutput.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/XMLOutput.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- XMLOutput.java    28 Oct 2004 22:21:43 -0000      1.20
  +++ XMLOutput.java    12 Jan 2005 08:58:45 -0000      1.21
  @@ -777,25 +777,28 @@
               lexicalHandler.comment(ch, start, length);
           }
       }
  -     
  -     /** Pass data through the pipline.
  -       * By default, this call is ignored.
  -       * Subclasses are invited to use this as a way for children tags to
  -       * pass data to their parent.
  -       * 
  -       * @param object the data to pass
  +    
  +    /** Pass data through the pipline.
  +      * By default, this call is ignored.
  +      * Subclasses are invited to use this as a way for children tags to
  +      * pass data to their parent.
  +      * 
  +      * @param object the data to pass
         * @exception SAXException The application may raise an exception.
  -       */
  -     public void objectData(Object object) throws SAXException {
  -             String output=null;
  -             if(object!=null) {
  -                     output=object.toString();
  -                     write(output);
  -             } else {
  -                     // we could have a "configurable null-toString"...
  -                     write("null");
  -             }
  -     }
  +      */
  +    public void objectData(Object object) throws SAXException {
  +        if(contentHandler instanceof XMLOutput)
  +            ((XMLOutput) contentHandler).objectData(object);
  +        else {
  +            if(object!=null) {
  +                String output=object.toString();
  +                write(output);
  +            } else {
  +                // we could have a "configurable null-toString"...
  +                write("null");
  +            }
  +        }
  +    }
   
       // Properties
       
//-------------------------------------------------------------------------
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to