You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2002/08/25 07:56:40 UTC
cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet blockinfo.xdt manifest.xdt mxinfo.xdt BlockInfoSubTask.java ManifestSubTask.java MxInfoSubTask.java PhoenixXDoclet.java blockinfo.j manifest.j mxinfo.j
donaldp 2002/08/24 22:56:40
Modified: src/java/org/apache/avalon/phoenix/tools/xdoclet
BlockInfoSubTask.java ManifestSubTask.java
MxInfoSubTask.java PhoenixXDoclet.java
Added: lib/xdoclet commons-logging.jar xdoclet-20020825.jar
xjavadoc-20020825.jar
src/java/org/apache/avalon/phoenix/tools/xdoclet
blockinfo.xdt manifest.xdt mxinfo.xdt
Removed: lib/xdoclet xdoclet-20021804.jar xjavadoc-20021804.jar
src/java/org/apache/avalon/phoenix/tools/xdoclet blockinfo.j
manifest.j mxinfo.j
Log:
Upgrade to the latest XDoclet that is supposedly stable.
Revision Changes Path
1.1 jakarta-avalon-phoenix/lib/xdoclet/commons-logging.jar
<<Binary file>>
1.1 jakarta-avalon-phoenix/lib/xdoclet/xdoclet-20020825.jar
<<Binary file>>
1.1 jakarta-avalon-phoenix/lib/xdoclet/xjavadoc-20020825.jar
<<Binary file>>
1.11 +12 -84 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/BlockInfoSubTask.java
Index: BlockInfoSubTask.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/BlockInfoSubTask.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- BlockInfoSubTask.java 6 Aug 2002 11:57:42 -0000 1.10
+++ BlockInfoSubTask.java 25 Aug 2002 05:56:40 -0000 1.11
@@ -7,11 +7,9 @@
*/
package org.apache.avalon.phoenix.tools.xdoclet;
-import java.io.File;
import java.net.URL;
import xdoclet.TemplateSubTask;
import xdoclet.XDocletException;
-import xjavadoc.XClass;
/**
* Generates BlockInfo 'xinfo' for Blocks
@@ -23,96 +21,26 @@
public class BlockInfoSubTask
extends TemplateSubTask
{
- public static final String SUBTASK_NAME = "blockinfo";
-
- private static final String GENERATED_FILE_NAME = "{0}.xinfo";
-
private static final String DEFAULT_TEMPLATE_FILE =
- "/org/apache/avalon/phoenix/tools/xdoclet/blockinfo.j";
-
- private static String c_classPattern;
-
- private String m_templatePath;
+ "/org/apache/avalon/phoenix/tools/xdoclet/blockinfo.xdt";
public BlockInfoSubTask()
{
- final URL resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
- setTemplateURL( resource );
- setDestinationFile( GENERATED_FILE_NAME );
- setHavingClassTag( "phoenix:block" );
-
- final TemplateSubTask.ExtentTypes extent = new TemplateSubTask.ExtentTypes();
- extent.setValue( "hierarchy" );
- setExtent( extent );
- }
-
- public void setTemplatePath( final String templatePath )
- {
- m_templatePath = templatePath;
- setTemplateFile( new File( templatePath ) );
- }
-
- public static String getClassPattern()
- {
- return c_classPattern;
+ setupParams();
}
- public String getSubTaskName()
+ private void setupParams()
{
- return SUBTASK_NAME;
- }
-
- public void setPattern( final String classPattern )
- {
- c_classPattern = classPattern;
- }
-
- /**
- * Called to validate configuration parameters.
- */
- public void validateOptions()
- throws XDocletException
- {
- super.validateOptions();
-
- if( null == m_templatePath )
- {
- throw new XDocletException( "'templatePath' attribute is missing ." );
- }
-
- final URL template = getTemplateURL();
- if( null == template )
- {
- throw new XDocletException( "'template' is missing." );
- }
-
- if( null == getClassPattern() || getClassPattern().trim().equals( "" ) )
- {
- throw new XDocletException( "'pattern' parameter missing or empty." );
- }
-
- if( -1 == getClassPattern().indexOf( "{0}" ) )
- {
- throw new XDocletException( "'pattern' parameter does not have a "
- + "'{0}' in it. '{0}' is replaced by Block "
- + "name of the class under processing." );
- }
+ setSubTaskName( "blockinfo" );
+ final URL resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
+ setTemplateURL( resource );
+ setDestinationFile( "{0}.xinfo" );
+ setAcceptAbstractClasses( false );
+ setHavingClassTag( "phoenix:block" );
}
- protected boolean matchesGenerationRules( final XClass clazz )
- throws XDocletException
+ protected void engineStarted() throws XDocletException
{
- if( !super.matchesGenerationRules( clazz ) )
- {
- return false;
- }
- else if( clazz.isAbstract() )
- {
- return false;
- }
- else
- {
- return true;
- }
+ System.out.println( "Generating BlockInfo file: " + getGeneratedFileName( getCurrentClass() ) );
}
}
1.9 +13 -81 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/ManifestSubTask.java
Index: ManifestSubTask.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/ManifestSubTask.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ManifestSubTask.java 6 Aug 2002 11:57:42 -0000 1.8
+++ ManifestSubTask.java 25 Aug 2002 05:56:40 -0000 1.9
@@ -7,11 +7,9 @@
*/
package org.apache.avalon.phoenix.tools.xdoclet;
-import java.io.File;
import java.net.URL;
import xdoclet.TemplateSubTask;
import xdoclet.XDocletException;
-import xjavadoc.XClass;
/**
* Generates Manifest file for Blocks
@@ -19,36 +17,18 @@
* @author <a href="mailto:vinay_chandran@users.sourceforge.net">Vinay Chandrasekharan</a>
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision$ $Date$
+ * @ant.element display-name="Manifest" name="manifest" parent="org.apache.avalon.phoenix.tools.xdoclet.PhoenixXDocletTask"
*/
public class ManifestSubTask
extends TemplateSubTask
{
- public static final String SUBTASK_NAME = "manifest";
-
- private static final String GENERATED_FILE_NAME = "manifest.mf";
-
private static final String DEFAULT_TEMPLATE_FILE =
- "/org/apache/avalon/phoenix/tools/xdoclet/manifest.j";
-
- private static String c_classPattern;
-
+ "/org/apache/avalon/phoenix/tools/xdoclet/manifest.xdt";
private String m_manifestFile;
public ManifestSubTask()
{
- final URL resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
- setTemplateURL( resource );
- setDestinationFile( GENERATED_FILE_NAME );
- setOfType( "org.apache.avalon.phoenix.Block" );
-
- final TemplateSubTask.ExtentTypes extent = new TemplateSubTask.ExtentTypes();
- extent.setValue( "hierarchy" );
- setExtent( extent );
- }
-
- public void setTemplatePath( final String templatePath )
- {
- setTemplateFile( new File( templatePath ) );
+ setupParams();
}
public void setManifestFile( final String manifestFile )
@@ -57,66 +37,18 @@
setDestinationFile( m_manifestFile );
}
- public static String getClassPattern()
- {
- return c_classPattern;
- }
-
- public String getSubTaskName()
+ private void setupParams()
{
- return SUBTASK_NAME;
- }
-
- public void setPattern( final String classPattern )
- {
- c_classPattern = classPattern;
- }
-
- /**
- * Called to validate configuration parameters.
- */
- public void validateOptions()
- throws XDocletException
- {
- super.validateOptions();
-
- if( null == m_manifestFile )
- {
- throw new XDocletException( "'manifestFile' attribute is missing ." );
- }
-
- if( null == getDestinationFile()
- || getDestinationFile().trim().equals( "" ) )
- {
- throw new XDocletException( "Error with the 'manifestFile' attribute." );
- }
-
- if( null == getClassPattern()
- || getClassPattern().trim().equals( "" ) )
- {
- throw new XDocletException( "'pattern' parameter missing or empty." );
- }
-
- if( -1 == getClassPattern().indexOf( "{0}" ) )
- {
- throw new XDocletException( "'pattern' parameter does not have a '{0}' in it. " );
- }
+ setSubTaskName( "manifest" );
+ final URL resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
+ setTemplateURL( resource );
+ setDestinationFile( "manifest.mf" );
+ setOfType( "org.apache.avalon.phoenix.Block" );
+ setAcceptAbstractClasses( false );
}
- protected boolean matchesGenerationRules( final XClass clazz )
- throws XDocletException
+ protected void engineStarted() throws XDocletException
{
- if( !super.matchesGenerationRules( clazz ) )
- {
- return false;
- }
- else if( clazz.isAbstract() )
- {
- return false;
- }
- else
- {
- return true;
- }
+ System.out.println( "Generating Manifest file: " + getDestinationFile() );
}
}
1.3 +13 -73 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/MxInfoSubTask.java
Index: MxInfoSubTask.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/MxInfoSubTask.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MxInfoSubTask.java 7 Aug 2002 07:05:30 -0000 1.2
+++ MxInfoSubTask.java 25 Aug 2002 05:56:40 -0000 1.3
@@ -7,101 +7,41 @@
*/
package org.apache.avalon.phoenix.tools.xdoclet;
-import java.io.File;
import java.net.URL;
import xdoclet.TemplateSubTask;
import xdoclet.XDocletException;
-import xjavadoc.XClass;
/**
* Generates MxBean info for Blocks and other classes
*
* @author <a href="mailto:huw@mmlive.com">Huw Roberts</a>
- * @version $$
+ * @ant.element display-name="MxInfo" name="mxinfo" parent="org.apache.avalon.phoenix.tools.xdoclet.PhoenixXDocletTask"
*/
public class MxInfoSubTask
extends TemplateSubTask
{
- public static final String SUBTASK_NAME = "mxinfo";
-
- private static final String GENERATED_FILE_NAME = "{0}.mxinfo";
private static final String DEFAULT_TEMPLATE_FILE =
- "/org/apache/avalon/phoenix/tools/xdoclet/mxinfo.j";
-
- private static String c_classPattern;
-
- private String m_templatePath;
+ "/org/apache/avalon/phoenix/tools/xdoclet/mxinfo.xdt";
public MxInfoSubTask()
{
- final URL resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
- setTemplateURL( resource );
- setDestinationFile( GENERATED_FILE_NAME );
-
- final TemplateSubTask.ExtentTypes extent = new TemplateSubTask.ExtentTypes();
- extent.setValue( "hierarchy" );
- setExtent( extent );
- }
-
- public void setTemplatePath( final String templatePath )
- {
- m_templatePath = templatePath;
- setTemplateFile( new File( templatePath ) );
+ setupParams();
}
- public static String getClassPattern()
+ private void setupParams()
{
- return c_classPattern;
- }
-
- public String getSubTaskName()
- {
- return SUBTASK_NAME;
- }
-
- public void setPattern( final String classPattern )
- {
- c_classPattern = classPattern;
- }
-
- /**
- * Called to validate configuration parameters.
- */
- public void validateOptions()
- throws XDocletException
- {
- super.validateOptions();
-
- if( null == m_templatePath )
- {
- throw new XDocletException( "'templatePath' attribute is missing ." );
- }
-
- final URL template = getTemplateURL();
- if( null == template )
- {
- throw new XDocletException( "'template' is missing." );
- }
-
- if( null == getClassPattern() || getClassPattern().trim().equals( "" ) )
- {
- throw new XDocletException( "'pattern' parameter missing or empty." );
- }
+ setSubTaskName( "mxinfo" );
+ final URL resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
+ setTemplateURL( resource );
+ setDestinationFile( "{0}.mxinfo" );
- if( -1 == getClassPattern().indexOf( "{0}" ) )
- {
- throw new XDocletException( "'pattern' parameter does not have a " +
- "'{0}' in it. '{0}' is replaced by Block " +
- "name of the class under processing." );
- }
+ // need to do this here instead of setting setHavingClassTag() because want to match on either
+ // phoenix:mx-topic or phoenix:mx-proxy.
+ setHavingClassTag( "phoenix:mx-topic" );
}
- protected boolean matchesGenerationRules( final XClass clazz )
- throws XDocletException
+ protected void engineStarted() throws XDocletException
{
- // need to do this here instead of setting setHavingClassTag() because want to match on either
- // phoenix:mx-topic or phoenix:mx-proxy.
- return super.matchesGenerationRules( clazz ) &&
- ( clazz.doc().hasTag("phoenix:mx-topic", false) || clazz.doc().hasTag("phoenix:mx-proxy", false) );
+ System.out.println( "Generating MxInfo file: " + getGeneratedFileName( getCurrentClass() ) );
}
}
1.8 +7 -8 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/PhoenixXDoclet.java
Index: PhoenixXDoclet.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/PhoenixXDoclet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PhoenixXDoclet.java 30 Jul 2002 12:17:21 -0000 1.7
+++ PhoenixXDoclet.java 25 Aug 2002 05:56:40 -0000 1.8
@@ -7,8 +7,8 @@
*/
package org.apache.avalon.phoenix.tools.xdoclet;
-import java.util.List;
import xdoclet.DocletTask;
+import org.apache.tools.ant.types.Path;
/**
* @author <a href="mailto:vinay_chandran@users.sourceforge.net">Vinay Chandrasekharan</a>
@@ -24,28 +24,27 @@
public BlockInfoSubTask createBlockinfo()
{
m_blockInfoSubTask = new BlockInfoSubTask();
+ addTemplate( m_blockInfoSubTask );
return m_blockInfoSubTask;
}
public ManifestSubTask createManifest()
{
m_manifestSubTask = new ManifestSubTask();
+ addTemplate( m_manifestSubTask );
return m_manifestSubTask;
}
public MxInfoSubTask createMxInfo()
{
m_mxinfoSubTask = new MxInfoSubTask();
+ addTemplate( m_mxinfoSubTask );
return m_mxinfoSubTask;
}
- protected List getSubTasks()
+ public void addClasspathRef( final Path path )
{
- final List subtasks = super.getSubTasks();
- subtasks.add( m_blockInfoSubTask );
- subtasks.add( m_manifestSubTask );
- subtasks.add( m_mxinfoSubTask );
- return subtasks;
+ System.out.println( "WARNING: classpathRef no longer required due to changes in underlying xdoclet" );
}
}
1.1 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/blockinfo.xdt
Index: blockinfo.xdt
===================================================================
<?xml version="1.0"?>
<!DOCTYPE blockinfo PUBLIC "-//PHOENIX/Block Info DTD Version 1.0//EN"
"http://jakarta.apache.org/phoenix/blockinfo_1_0.dtd">
<blockinfo>
<!-- section to describe block -->
<block>
<XDtClass:ifHasClassTag tagName="phoenix:block" paramName="name"><name><XDtClass:classTagValue tagName="phoenix:block" paramName="name"/></name></XDtClass:ifHasClassTag>
<version><XDtClass:classTagValue tagName="phoenix:block" paramName="version" default="1.0"/></version>
<XDtMethod:ifHasMethod name="configure" parameters="org.apache.avalon.framework.configuration.Configuration">
<XDtMethod:setCurrentMethod name="configure" parameters="org.apache.avalon.framework.configuration.Configuration">
<XDtMethod:ifHasMethodTag tagName="phoenix:configuration-schema">
<schema-type><XDtMethod:methodTagValue tagName="phoenix:configuration-schema" paramName="type"/></schema-type>
</XDtMethod:ifHasMethodTag>
</XDtMethod:setCurrentMethod>
</XDtMethod:ifHasMethod>
</block>
<!-- services that are offered by this block -->
<services>
<XDtClass:forAllClassTags tagName="phoenix:service">
<service name="<XDtClass:classTagValue tagName="phoenix:service" paramName="name"/>"<XDtClass:ifHasClassTag tagName="phoenix:service" paramName="version"> version="<XDtClass:classTagValue tagName="phoenix:service" paramName="version"/>"</XDtClass:ifHasClassTag>/>
</XDtClass:forAllClassTags>
</services>
<!-- interfaces that may be exported to manange this block -->
<management-access-points>
<XDtClass:forAllClassTags tagName="phoenix:mx">
<service name="<XDtClass:classTagValue tagName="phoenix:mx" paramName="name"/>"<XDtClass:ifHasClassTag tagName="phoenix:mx" paramName="version"> version="<XDtClass:classTagValue tagName="phoenix:mx" paramName="version"/>"</XDtClass:ifHasClassTag>/>
</XDtClass:forAllClassTags>
</management-access-points>
<!-- services that are required by this block -->
<dependencies>
<XDtMethod:ifHasMethod name="compose"
parameters="org.apache.avalon.framework.component.ComponentManager">
<XDtMethod:setCurrentMethod name="compose"
parameters="org.apache.avalon.framework.component.ComponentManager">
<XDtMethod:forAllMethodTags tagName="phoenix:dependency">
<dependency>
<service name="<XDtMethod:methodTagValue tagName="phoenix:dependency" paramName="name"/>"<XDtMethod:ifHasMethodTag tagName="phoenix:dependency" paramName="version"> version="<XDtMethod:methodTagValue tagName="phoenix:dependency" paramName="version"/>"</XDtMethod:ifHasMethodTag>/>
</dependency>
</XDtMethod:forAllMethodTags>
</XDtMethod:setCurrentMethod>
</XDtMethod:ifHasMethod>
<XDtMethod:ifHasMethod name="service"
parameters="org.apache.avalon.framework.service.ServiceManager">
<XDtMethod:setCurrentMethod name="service"
parameters="org.apache.avalon.framework.service.ServiceManager">
<XDtMethod:forAllMethodTags tagName="phoenix:dependency">
<dependency>
<service name="<XDtMethod:methodTagValue tagName="phoenix:dependency" paramName="name"/>"<XDtMethod:ifHasMethodTag tagName="phoenix:dependency" paramName="version"> version="<XDtMethod:methodTagValue tagName="phoenix:dependency" paramName="version"/>"</XDtMethod:ifHasMethodTag>/>
</dependency>
</XDtMethod:forAllMethodTags>
</XDtMethod:setCurrentMethod>
</XDtMethod:ifHasMethod>
</dependencies>
</blockinfo>
1.1 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/manifest.xdt
Index: manifest.xdt
===================================================================
Manifest-Version: 1.0
Created-By: Apache Avalon Project
<XDtClass:forAllClasses abstract="false">
<XDtClass:ifHasClassTag tagName="phoenix:block">
Name: <XDtPackage:packageNameAsPath/>/<XDtClass:className/>.class
Avalon-Block: true
</XDtClass:ifHasClassTag>
</XDtClass:forAllClasses>
1.1 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/xdoclet/mxinfo.xdt
Index: mxinfo.xdt
===================================================================
<?xml version="1.0"?>
<!DOCTYPE mxinfo PUBLIC "-//PHOENIX/Mx Info DTD Version 1.0//EN"
"http://jakarta.apache.org/phoenix/mxinfo_1_0.dtd">
<mxinfo>
<XDtClass:ifHasClassTag tagName="phoenix:mx-topic" paramName="name">
<topic name="<XDtClass:classTagValue tagName="phoenix:mx-topic" paramName="name"/>" >
<!-- attributes -->
<XDtMethod:forAllMethods>
<XDtMethod:ifHasMethodTag tagName="phoenix:mx-attribute" >
<attribute
name="<XDtMethod:propertyName/>"
<XDtMethod:ifHasMethodTag tagName="phoenix:mx-description" >
description="<XDtMethod:methodTagValue tagName="phoenix:mx-description" />"
</XDtMethod:ifHasMethodTag>
<XDtMethod:ifDoesntHaveMethodTag tagName="phoenix:mx-description" >
description="<XDtMethod:methodComment no-comment-signs="true" />"
</XDtMethod:ifDoesntHaveMethodTag>
<XDtMethod:ifHasMethodTag tagName="phoenix:mx-isWriteable" >
isWriteable="<XDtMethod:methodTagValue tagName="phoenix:mx-isWriteable" />"
</XDtMethod:ifHasMethodTag>
type="<XDtMethod:methodType/>"
/>
</XDtMethod:ifHasMethodTag>
</XDtMethod:forAllMethods>
<!-- operations -->
<XDtMethod:forAllMethods>
<XDtMethod:ifHasMethodTag tagName="phoenix:mx-operation" >
<operation
name="<XDtMethod:methodName/>"
<XDtMethod:ifHasMethodTag tagName="phoenix:mx-description" >
description="<XDtMethod:methodTagValue tagName="phoenix:mx-description" />"
</XDtMethod:ifHasMethodTag>
<XDtMethod:ifDoesntHaveMethodTag tagName="phoenix:mx-description" >
description="<XDtMethod:methodComment no-comment-signs="true" />"
</XDtMethod:ifDoesntHaveMethodTag>
type="<XDtMethod:methodType/>"
>
<XDtParameter:forAllMethodParams>
<param
name="<XDtParameter:methodParamName/>"
description="<XDtParameter:methodParamDescription/>"
type="<XDtParameter:methodParamType/>"
/>
</XDtParameter:forAllMethodParams>
</operation>
</XDtMethod:ifHasMethodTag>
</XDtMethod:forAllMethods>
</topic>
</XDtClass:ifHasClassTag>
<XDtClass:ifHasClassTag tagName="phoenix:mx-proxy" paramName="class">
<proxy name="<XDtClass:classTagValue tagName="phoenix:mx-proxy" paramName="class"/>" />
</XDtClass:ifHasClassTag>
</mxinfo>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>