cvs commit: spice/sandbox/metaclass/src/java/org/realityforge/metaclass/io SAXMetaClassSerializer.java

Peter Donald <[email protected]>
Newsgroups gmane.comp.java.spice.cvs
Message-ID <[email protected]>
donaldp     03/10/27 20:23:14

  Modified:    sandbox/metaclass/src/java/org/realityforge/metaclass/io
                        SAXMetaClassSerializer.java
  Log:
  Serialize attributes as an array of attributes rather than attributes attached to feature. (Simpler to unit test).
  
  Revision  Changes    Path
  1.4       +8 -10     spice/sandbox/metaclass/src/java/org/realityforge/metaclass/io/SAXMetaClassSerializer.java
  
  Index: SAXMetaClassSerializer.java
  ===================================================================
  RCS file: /cvsroot/spice/spice/sandbox/metaclass/src/java/org/realityforge/metaclass/io/SAXMetaClassSerializer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SAXMetaClassSerializer.java	28 Oct 2003 04:15:24 -0000	1.3
  +++ SAXMetaClassSerializer.java	28 Oct 2003 04:23:14 -0000	1.4
  @@ -7,9 +7,8 @@
    */
   package org.realityforge.metaclass.io;
   
  -import org.realityforge.metaclass.model.ClassDescriptor;
   import org.realityforge.metaclass.model.Attribute;
  -import org.realityforge.metaclass.model.FeatureDescriptor;
  +import org.realityforge.metaclass.model.ClassDescriptor;
   import org.realityforge.metaclass.model.FieldDescriptor;
   import org.realityforge.metaclass.model.MethodDescriptor;
   import org.realityforge.metaclass.model.ParameterDescriptor;
  @@ -22,7 +21,7 @@
    * to a SAX2 compliant ContentHandler.
    *
    * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2003/10/28 04:15:24 $
  + * @version $Revision: 1.4 $ $Date: 2003/10/28 04:23:14 $
    */
   public class SAXMetaClassSerializer
   {
  @@ -135,7 +134,7 @@
         start( handler, CLASS_ELEMENT, atts );
         serializeFields( handler, descriptor.getFields() );
         serializeMethods( handler, descriptor.getMethods() );
  -      serializeAttributes( handler, descriptor );
  +      serializeAttributes( handler, descriptor.getAttributes() );
         end( handler, CLASS_ELEMENT );
      }
   
  @@ -177,7 +176,7 @@
         add( atts, NAME_ATTRIBUTE, descriptor.getName() );
         add( atts, TYPE_ATTRIBUTE, descriptor.getName() );
         start( handler, FIELD_ELEMENT, atts );
  -      serializeAttributes( handler, descriptor );
  +      serializeAttributes( handler, descriptor.getAttributes() );
         end( handler, FIELD_ELEMENT );
      }
   
  @@ -220,7 +219,7 @@
         add( atts, TYPE_ATTRIBUTE, descriptor.getName() );
         start( handler, METHOD_ELEMENT, atts );
         serializeParameters( handler, descriptor.getParameters() );
  -      serializeAttributes( handler, descriptor );
  +      serializeAttributes( handler, descriptor.getAttributes() );
         end( handler, METHOD_ELEMENT );
      }
   
  @@ -260,17 +259,16 @@
      }
   
      /**
  -    * Serialize attributes attached to feature.
  +    * Serialize attributes.
       *
       * @param handler the handler
  -    * @param descriptor the descriptor
  +    * @param attributes the attributes
       * @throws SAXException if error during serilization
       */
      void serializeAttributes( final ContentHandler handler,
  -                             final FeatureDescriptor descriptor )
  +                             final Attribute[] attributes )
         throws SAXException
      {
  -      final Attribute[] attributes = descriptor.getAttributes();
         if ( 0 == attributes.length )
         {
            return;
  
  
  


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.