Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2989 - development/main/metro/composition/builder/src/main/net/dpml/composition/builder

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2989 - development/main/metro/composition/builder/src/main/net/dpml/composition/builder
  • Date: Wed, 06 Jul 2005 19:08:23 -0400

Author: mcconnell AT dpml.net
Date: Wed Jul 6 19:08:23 2005
New Revision: 2989

Modified:

development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
Log:
o Add support for the creation of Type info in xml

Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/TypeBuilderTask.java
Wed Jul 6 19:08:23 2005
@@ -21,6 +21,8 @@
import java.beans.IntrospectionException;
import java.io.IOException;
import java.io.InputStream;
+import java.io.File;
+import java.io.FileWriter;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -52,6 +54,10 @@

import org.apache.tools.ant.BuildException;

+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+
/**
* The TypeTask creates a serialized descriptor of a component type.
*
@@ -179,9 +185,33 @@
Configuration config = createDefaultConfiguration( subject );
State graph = resolveStateGraph( subject );

- // TODO: add state model
+ Type type = new Type( graph, info, categories, context, services,
config, parts );
+
+ File target = getContext().getTargetDirectory();
+ File reports = new File( target, "reports/types" );
+ reports.mkdirs();

- return new Type( graph, info, categories, context, services, config,
parts );
+ File report = getReportDestination( reports, type );
+ try
+ {
+ XStream XStream = new XStream( new DomDriver() );
+ XStream.alias( "type", Type.class );
+ XStream.toXML( type, new FileWriter( report ) );
+ }
+ catch( Throwable e )
+ {
+ log( "XML reporting failed due to: " + e.toString() );
+ }
+
+ return type;
+ }
+
+ private File getReportDestination( File dir, Type type )
+ {
+ final String classname = type.getInfo().getClassname();
+ String path = classname.replace( '.', '-' );
+ String filename = path + ".xml";
+ return new File( dir, filename );
}

//---------------------------------------------------------------



  • svn commit: r2989 - development/main/metro/composition/builder/src/main/net/dpml/composition/builder, mcconnell, 07/06/2005

Archive powered by MHonArc 2.6.24.

Top of Page