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/07 18:53:21 UTC
svn commit: rev 22678 - in excalibur/branches/fortress-experiments/meta/src: java/org/apache/avalon/fortress/tools testdata/org/apache/excalibur
Author: hammett
Date: Wed Jul 7 09:53:20 2004
New Revision: 22678
Modified:
excalibur/branches/fortress-experiments/meta/src/java/org/apache/avalon/fortress/tools/Component.java
excalibur/branches/fortress-experiments/meta/src/testdata/org/apache/excalibur/DefaultMailService.java
Log:
Load and store the methods attributes as well.
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 Wed Jul 7 09:53:20 2004
@@ -65,7 +65,6 @@
private final Vertex m_vertex;
private final List m_dependencyNames;
private final List m_serviceNames;
- private final DocletTag[] m_otherAttributes;
/**
* Initialize a service with the type name.
@@ -85,8 +84,7 @@
m_vertex = new Vertex( this );
m_dependencyNames = new ArrayList( 10 );
m_serviceNames = new ArrayList( 10 );
- m_otherAttributes = m_javaClass.getTags();
-
+
final DocletTag[] tags = javaClass.getTagsByName( TAG_SERVICE );
for ( int t = 0; t < tags.length; t++ )
{
@@ -376,28 +374,34 @@
{
writer = new PrintWriter( new FileOutputStream( output ) );
- for (int i = 0; i < m_otherAttributes.length; i++)
+ 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++ )
{
- DocletTag tag = m_otherAttributes[i];
- writer.print( tag.getName() );
- writer.print( " [" );
- String[] parameters = tag.getParameters();
- boolean separator = false;
- for (int j = 0; j < parameters.length; j++)
+ JavaMethod method = methods[i];
+ tags = method.getTags();
+
+ if (tags.length == 0)
{
- String parameter = parameters[j];
- writer.print( parameter );
- if (!separator)
- {
- separator = true;
- }
- else
- {
- writer.print( ';' );
- }
+ continue;
+ }
+
+ for (int j = 0; j < tags.length; j++)
+ {
+ DocletTag tag = tags[j];
+ writeDocletTag( writer, method, tag );
}
- writer.println( ']' );
}
+
}
finally
{
@@ -406,6 +410,49 @@
writer.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 )
Modified: excalibur/branches/fortress-experiments/meta/src/testdata/org/apache/excalibur/DefaultMailService.java
==============================================================================
--- excalibur/branches/fortress-experiments/meta/src/testdata/org/apache/excalibur/DefaultMailService.java (original)
+++ excalibur/branches/fortress-experiments/meta/src/testdata/org/apache/excalibur/DefaultMailService.java Wed Jul 7 09:53:20 2004
@@ -25,6 +25,9 @@
*/
public class DefaultMailService implements MailService
{
+ /**
+ * @excalibur.passthrought
+ */
public void sendMail( String to, String from, String message )
{
}
---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org