Return-Path: Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 12569 invoked by uid 500); 4 Jun 2003 02:02:56 -0000 Mailing-List: contact cvs-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list cvs@avalon.apache.org Received: (qmail 12558 invoked by uid 500); 4 Jun 2003 02:02:56 -0000 Received: (qmail 12555 invoked from network); 4 Jun 2003 02:02:56 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 4 Jun 2003 02:02:56 -0000 Received: (qmail 83868 invoked by uid 1438); 4 Jun 2003 02:02:55 -0000 Date: 4 Jun 2003 02:02:55 -0000 Message-ID: <20030604020255.83867.qmail@icarus.apache.org> From: mcconnell@apache.org To: avalon-sandbox-cvs@apache.org Subject: cvs commit: avalon-sandbox/merlin/meta-tools/src/java/org/apache/avalon/meta/info/builder XMLTypeWriter.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mcconnell 2003/06/03 19:02:55 Modified: merlin/merlin-smp/xdocs/tools/tags extension.xml stage.xml merlin/meta-tools/src/java/org/apache/avalon/meta/info/builder XMLTypeWriter.java Log: Updates to meta-tools documentation from David Bernard and commmitted TypeWriter changes to support extension and stage handling. Revision Changes Path 1.2 +3 -3 avalon-sandbox/merlin/merlin-smp/xdocs/tools/tags/extension.xml Index: extension.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-smp/xdocs/tools/tags/extension.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- extension.xml 5 Apr 2003 09:04:16 -0000 1.1 +++ extension.xml 4 Jun 2003 02:02:54 -0000 1.2 @@ -22,7 +22,7 @@ * * @avalon.meta.version 0.1 * @avalon.meta.name handler - * @avalon.meta.extension type="org.apache.avalon.plyground.Demonstratable"; + * @avalon.meta.extension type="org.apache.avalon.plyground.Demonstratable" */ public class DemoExtension { @@ -40,7 +40,7 @@ - + ]]> 1.3 +3 -3 avalon-sandbox/merlin/merlin-smp/xdocs/tools/tags/stage.xml Index: stage.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-smp/xdocs/tools/tags/stage.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- stage.xml 7 Apr 2003 08:49:52 -0000 1.2 +++ stage.xml 4 Jun 2003 02:02:54 -0000 1.3 @@ -23,7 +23,7 @@ * * @avalon.meta.version 0.1 * @avalon.meta.name extended-component - * @avalon.meta.stage type="org.apache.avalon.playground.Demonstratable"; + * @avalon.meta.stage type="org.apache.avalon.playground.Demonstratable" */ public class DemoComponent implements Demonstratable { @@ -41,7 +41,7 @@ - + ]]> 1.5 +83 -1 avalon-sandbox/merlin/meta-tools/src/java/org/apache/avalon/meta/info/builder/XMLTypeWriter.java Index: XMLTypeWriter.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/meta-tools/src/java/org/apache/avalon/meta/info/builder/XMLTypeWriter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- XMLTypeWriter.java 8 May 2003 03:02:40 -0000 1.4 +++ XMLTypeWriter.java 4 Jun 2003 02:02:54 -0000 1.5 @@ -61,6 +61,8 @@ import org.apache.avalon.meta.info.InfoDescriptor; import org.apache.avalon.meta.info.LoggerDescriptor; import org.apache.avalon.meta.info.ServiceDescriptor; +import org.apache.avalon.meta.info.StageDescriptor; +import org.apache.avalon.meta.info.ExtensionDescriptor; import org.apache.avalon.meta.info.Type; /** @@ -97,6 +99,8 @@ writeContext( writer, type.getContext() ); writeServices( writer, type.getServices() ); writeDependencies( writer, type.getDependencies() ); + writeStages( writer, type.getStages() ); + writeExtensions( writer, type.getExtensions() ); writer.write( "\n" ); writer.flush(); } @@ -412,5 +416,83 @@ writer.write( "\" value=\"" ); writer.write( value ); writer.write( "\"/>" ); + } + + /** + * Write out xml representation of a set of stages. + * + * @param writer the writer + * @param stages the stages + * @throws IOException if unable to write xml + */ + private void writeStages( final Writer writer, + final StageDescriptor[] stages ) + throws IOException + { + if( 0 == stages.length ) + { + return; + } + + writer.write( "\n " ); + for( int i = 0; i < stages.length; i++ ) + { + final StageDescriptor stage = stages[ i ]; + writer.write( "\n " ); + } + else + { + writer.write( "\">" ); + writeAttributes( writer, stage ); + writer.write( "\n " ); + } + } + writer.write( "\n " ); + } + + /** + * Write out xml representation of a set of extensions. + * + * @param writer the writer + * @param extensions the extensions + * @throws IOException if unable to write xml + */ + private void writeExtensions( final Writer writer, + final ExtensionDescriptor[] extensions ) + throws IOException + { + if( 0 == extensions.length ) + { + return; + } + + writer.write( "\n " ); + for( int i = 0; i < extensions.length; i++ ) + { + final ExtensionDescriptor extension = extensions[ i ]; + writer.write( "\n " ); + } + else + { + writer.write( "\">" ); + writeAttributes( writer, extension ); + writer.write( "\n " ); + } + } + writer.write( "\n " ); } } --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org