User: ko5tik  
  Date: 02/04/06 06:39:29

  Modified:    src/java/xtags Tag.java TagFamily.java
  Log:
  use real tag parameters in TagParameterTreeNode
  
  Revision  Changes    Path
  1.4       +45 -0     xdocletgui/src/java/xtags/Tag.java
  
  Index: Tag.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdocletgui/src/java/xtags/Tag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- Tag.java  4 Apr 2002 17:13:39 -0000       1.3
  +++ Tag.java  6 Apr 2002 14:39:29 -0000       1.4
  @@ -37,6 +37,8 @@
   
   import java.util.List;
   import java.util.ArrayList;
  +import java.util.Collections;
  +import java.util.TreeMap;
   import xjavadoc.XProgramElement;
   import xtags.condition.Or;
   import xtags.condition.Condition;
  @@ -47,6 +49,10 @@
    * @todo implement DocumentedSupporter.supports( Documented )
    */
   public class Tag {
  +     /**
  +      * map used for searching tag parameters
  +      */
  +     private final TreeMap _parameterMap;
   
        /**
         * Name of the tag
  @@ -89,6 +95,32 @@
                _tagName = tagName;
                _tagUsage = tagUsage;
                _or = or;
  +             _parameterMap = new TreeMap();
  +     }
  +
  +
  +     /**
  +      * return tag parameter object by name
  +      *
  +      * @param parameterName Describe what the parameter does
  +      * @return tag parameter object by name
  +      * @todo-javadoc Write javadocs for method parameter
  +      */
  +     public TagParameter getParameter(String parameterName) {
  +             if (_parameterMap.containsKey(parameterName)) {
  +                     return (TagParameter)_parameterMap.get(parameterName);
  +             }
  +             else {
  +                     // not found yet, walk through all the tags
  +                     for (int i = 0; i < size(); i++) {
  +                             TagParameter t = getTagParameter(i);
  +                             if (t.getName().equals(parameterName)) {
  +                                     _parameterMap.put(parameterName, t);
  +                                     return t;
  +                             }
  +                     }
  +             }
  +             return null;
        }
   
   
  @@ -121,6 +153,19 @@
         */
        public String getUsage() {
                return _tagUsage;
  +     }
  +
  +
  +     /**
  +      * return whether tag has given parameter defined
  +      *
  +      * @param parameterName Describe what the parameter does
  +      * @return Describe the return value
  +      * @todo-javadoc Write javadocs for method parameter
  +      * @todo-javadoc Write javadocs for return value
  +      */
  +     public boolean hasParameter(String parameterName) {
  +             return getParameter(parameterName) != null;
        }
   
   
  
  
  
  1.7       +4 -7      xdocletgui/src/java/xtags/TagFamily.java
  
  Index: TagFamily.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdocletgui/src/java/xtags/TagFamily.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- TagFamily.java    5 Apr 2002 16:50:33 -0000       1.6
  +++ TagFamily.java    6 Apr 2002 14:39:29 -0000       1.7
  @@ -135,9 +135,8 @@
        /**
         * return tag object by name
         *
  -      * @param tagName Describe what the parameter does
  -      * @return The Tag value
  -      * @todo-javadoc Write javadocs for method parameter
  +      * @param tagName tag name to be looked up
  +      * @return The tag object
         */
        public Tag getTag(String tagName) {
                if (_tagMap.containsKey(tagName)) {
  @@ -193,10 +192,8 @@
        /**
         * return whether family contains tag with given name
         *
  -      * @param tagName Describe what the parameter does
  -      * @return Describe the return value
  -      * @todo-javadoc Write javadocs for method parameter
  -      * @todo-javadoc Write javadocs for return value
  +      * @param tagName tag name to lookup
  +      * @return whether family knows about the tag
         */
        public boolean hasTag(String tagName) {
                return getTag(tagName) != null;
  
  
  

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to