You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by ha...@apache.org on 2004/07/09 00:22:16 UTC
svn commit: rev 22736 - in excalibur/branches/fortress-experiments/meta: . src/java/org/apache/avalon/fortress/tools
Author: hammett
Date: Thu Jul 8 15:22:15 2004
New Revision: 22736
Modified:
excalibur/branches/fortress-experiments/meta/project.properties
excalibur/branches/fortress-experiments/meta/src/java/org/apache/avalon/fortress/tools/Component.java
Log:
Modified: excalibur/branches/fortress-experiments/meta/project.properties
==============================================================================
--- excalibur/branches/fortress-experiments/meta/project.properties (original)
+++ excalibur/branches/fortress-experiments/meta/project.properties Thu Jul 8 15:22:15 2004
@@ -23,3 +23,5 @@
# gump integration
project.name=excalibur-fortress-meta
+
+maven.junit.fork=true
\ No newline at end of file
Modified: excalibur/branches/fortress-experiments/meta/src/java/org/apache/avalon/fortress/tools/Component.java
==============================================================================
--- excalibur/branches/fortress-experiments/meta/src/java/org/apache/avalon/fortress/tools/Component.java (original)
+++ excalibur/branches/fortress-experiments/meta/src/java/org/apache/avalon/fortress/tools/Component.java Thu Jul 8 15:22:15 2004
@@ -19,13 +19,14 @@
import com.thoughtworks.qdox.model.*;
import org.apache.avalon.fortress.MetaInfoEntry;
+import org.apache.avalon.fortress.attributes.qdox.QDoxSerializer;
import org.apache.avalon.fortress.util.dag.Vertex;
import org.apache.tools.ant.BuildException;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.ObjectOutputStream;
import java.util.*;
/**
@@ -368,93 +369,21 @@
{
final File output = new File( packageDir, className + ".attrs" );
- PrintWriter writer = null;
+ FileOutputStream outStream = new FileOutputStream( output );
try
{
- writer = new PrintWriter( new FileOutputStream( output ) );
-
- DocletTag[] tags = m_javaClass.getTags();
-
- for (int i = 0; i < tags.length; i++)
- {
- DocletTag tag = tags[i];
- writeDocletTag( writer, null, tag );
- }
-
- // TODO: Do we need to inspect super classes?
- final JavaMethod[] methods = m_javaClass.getMethods();
-
- for ( int i = 0; i < methods.length; i++ )
- {
- JavaMethod method = methods[i];
- tags = method.getTags();
-
- if (tags.length == 0)
- {
- continue;
- }
-
- for (int j = 0; j < tags.length; j++)
- {
- DocletTag tag = tags[j];
- writeDocletTag( writer, method, tag );
- }
- }
-
+ ObjectOutputStream objOutStream = new ObjectOutputStream( outStream );
+ QDoxSerializer.instance().serialize( objOutStream, m_javaClass );
+ objOutStream.close();
}
finally
{
- if ( null != writer )
- {
- writer.close();
- }
+ outStream.flush();
+ outStream.close();
}
}
- private void writeDocletTag( PrintWriter writer, JavaMethod method, DocletTag tag )
- throws IOException
- {
- if (method != null)
- {
- writer.print( '{' );
- writer.print( method.getReturns().getValue() );
- writer.print( ' ' );
- writer.print( method.getName() );
- writer.print( '(' );
- JavaParameter[] params = method.getParameters();
- for (int i = 0; i < params.length; i++)
- {
- JavaParameter param = params[i];
- writer.print( param.getType().getValue() );
-
- if ( i + 1 < params.length )
- {
- writer.print( ',' );
- }
- }
- writer.print( ")} " );
- }
- writer.print( tag.getName() );
- writer.print( " [" );
- String[] parameters = tag.getParameters();
- boolean separator = false;
- for (int j = 0; j < parameters.length; j++)
- {
- String parameter = parameters[j];
- writer.print( parameter );
- if (!separator)
- {
- separator = true;
- }
- else
- {
- writer.print( ';' );
- }
- }
- writer.println( ']' );
- }
-
private String stripQuotes( final String value )
{
if ( null == value ) return null;
@@ -510,7 +439,7 @@
return className;
}
- private String checkImport ( final JavaSource sourceCode, final String type, final String className)
+ private String checkImport( final JavaSource sourceCode, final String type, final String className)
{
final String tail = type.substring( type.lastIndexOf( '.' ) + 1 );
---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org