ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build ant-roles.j AntTypeTagHandler.java
Date Tue, 25 Jun 2002 07:08:10 GMT
adammurdoch    2002/06/25 00:08:10

  Modified:    buildtools/src/java/org/apache/myrmidon/build ant-roles.j
                        AntTypeTagHandler.java
  Log:
  - Added tags for dealing with the params on @ant.role
  - ant-roles.j now copies across all the @ant.role params into the
    role descriptor.  These end up in RoleInfo.getAttributes()
    when the role is deployed.
  
  Revision  Changes    Path
  1.5       +8 -7      jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/ant-roles.j
  
  Index: ant-roles.j
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/ant-roles.j,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ant-roles.j	23 Jun 2002 08:06:39 -0000	1.4
  +++ ant-roles.j	25 Jun 2002 07:08:10 -0000	1.5
  @@ -1,11 +1,12 @@
   <roles version="1.0">
       <XDtClass:forAllClasses abstract="true">
  -      <XDtClass:ifHasClassTag tagName="ant.role" superclasses="false">
  -        <role name="<XDtClass:classTagValue tagName="ant.role" paramName="name"/>"
  -            <XDtClass:ifHasClassTag tagName="ant.role" paramName="type-deployer" superclasses="false">
  -              type-deployer="<XDtClass:classTagValue tagName="ant.role" paramName="type-deployer"/>"
  -            </XDtClass:ifHasClassTag>
  -              interface="<XDtClass:fullClassName/>"/>
  -      </XDtClass:ifHasClassTag>
  +      <XDtAnt:ifHasRoleTag>
  +        <role name="<XDtAnt:roleName/>"
  +              interface="<XDtClass:fullClassName/>"
  +          <XDtAnt:forAllRoleParams>
  +            <XDtAnt:roleParamName/>="<XDtAnt:roleParamValue/>"
  +          </XDtAnt:forAllRoleParams>
  +         />
  +      </XDtAnt:ifHasRoleTag>
       </XDtClass:forAllClasses>
   </roles>
  
  
  
  1.5       +44 -1     jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/AntTypeTagHandler.java
  
  Index: AntTypeTagHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/AntTypeTagHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AntTypeTagHandler.java	12 Jun 2002 06:51:04 -0000	1.4
  +++ AntTypeTagHandler.java	25 Jun 2002 07:08:10 -0000	1.5
  @@ -28,6 +28,8 @@
       extends XDocletTagSupport
   {
       private final Map m_nestedClasses;
  +    private String m_currentRoleParam;
  +    private String m_currentRoleParamValue;
   
       public AntTypeTagHandler( final Map nestedClasses )
       {
  @@ -161,6 +163,47 @@
               }
           }
           return buffer.toString();
  +    }
  +
  +    /**
  +     * Iterates over the role params of the current class.
  +     */
  +    public void forAllRoleParams( final String template )
  +        throws XDocletException
  +    {
  +        final XTag roleTag = getCurrentClass().getDoc().getTag( "ant.role", false );
  +        final String[] params = roleTag.getAttributeValueNames();
  +        for( int i = 0; i < params.length; i++ )
  +        {
  +            final String param = params[ i ];
  +            if( param.equals( "name" ) )
  +            {
  +                continue;
  +            }
  +
  +            m_currentRoleParam = param;
  +            m_currentRoleParamValue = roleTag.getAttributeValue( param );
  +            generate( template );
  +        }
  +
  +        m_currentRoleParam = null;
  +        m_currentRoleParamValue = null;
  +    }
  +
  +    /**
  +     * Returns the current role param name.
  +     */
  +    public String roleParamName()
  +    {
  +        return m_currentRoleParam;
  +    }
  +
  +    /**
  +     * Returns the current role param value.
  +     */
  +    public String roleParamValue()
  +    {
  +        return m_currentRoleParamValue;
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message