Update of 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-qtags/src/main/java/org/xdoclet/plugin/qtags/confluence
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30108/plugin-qtags/src/main/java/org/xdoclet/plugin/qtags/confluence

Modified Files:
        QTagConfluencePlugin.vm QTagConfluencePlugin.java 
Log Message:
Support to QTags to return array types: 
Tag values will be running through a StringTokenizer.
Each array value will be validated through if used it @qtags.allowed-value.
The StringTokenizer delimiter is by default "," but can also be ";" - This can 
be set using @qtags.list-token.
Note: Before @qtags.default was not being verified against a valid value set by 
@qtags.allowed-value.
Current generated tag impl changed this - The default value is set before 
values validation.



Index: QTagConfluencePlugin.vm
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-qtags/src/main/java/org/xdoclet/plugin/qtags/confluence/QTagConfluencePlugin.vm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** QTagConfluencePlugin.vm     30 Oct 2004 17:31:51 -0000      1.4
--- QTagConfluencePlugin.vm     21 Aug 2005 13:44:29 -0000      1.5
***************
*** 27,33 ****
  #set ($methods=$plugin.getMethodsWithTagParameters($class))
  #if ($methods.size() > 0)
! ||Parameter||Required||Allowed values||Default value||Description||
  #foreach ($method in $methods)
! |${plugin.getQTagUtils().getDocletTagParameterName($method)} 
|${plugin.getQTagUtils().isParameterRequired($method)} 
|$plugin.getAllowedValues($method) |$plugin.getDefaultValue($method) 
|$plugin.getDescription($method) |
  #end
  #end
--- 27,33 ----
  #set ($methods=$plugin.getMethodsWithTagParameters($class))
  #if ($methods.size() > 0)
! ||Parameter||Required||Allowed values||Default value||Array||Token 
separator||Description||
  #foreach ($method in $methods)
! |${plugin.getQTagUtils().getDocletTagParameterName($method)} 
|${plugin.getQTagUtils().isParameterRequired($method)} 
|$plugin.getAllowedValues($method) |$plugin.getDefaultValue($method) 
|$plugin.getArray($method) |$plugin.getArrayToken($method) 
|$plugin.getDescription($method) |
  #end
  #end

Index: QTagConfluencePlugin.java
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-qtags/src/main/java/org/xdoclet/plugin/qtags/confluence/QTagConfluencePlugin.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** QTagConfluencePlugin.java   31 May 2005 11:28:56 -0000      1.8
--- QTagConfluencePlugin.java   21 Aug 2005 13:44:29 -0000      1.9
***************
*** 14,17 ****
--- 14,18 ----
  
  import org.xdoclet.plugin.qtags.AbstractQTagsPlugin;
+ import org.xdoclet.plugin.qtags.QTagUtils;
  
  import com.thoughtworks.qdox.model.DocletTag;
***************
*** 28,31 ****
--- 29,34 ----
   */
  public class QTagConfluencePlugin extends AbstractQTagsPlugin {
+     private QTagUtils qTagUtils = new QTagUtils();
+     
      public QTagConfluencePlugin(VelocityTemplateEngine templateEngine, 
QDoxCapableMetadataProvider metadataProvider,
          WriterMapper writerMapper) {
***************
*** 36,40 ****
  
      public String getAllowedValues(JavaMethod method) {
!         if (method.getReturns().isA(new Type("boolean")) || 
method.getReturns().isA(new Type("java.lang.Boolean"))) {
              return "true, false";
          } else if (method.getTagByName("qtags.allowed-value") != null) {
--- 39,46 ----
  
      public String getAllowedValues(JavaMethod method) {
!         if (method.getReturns().isA(new Type("boolean")) 
!             ||  method.getReturns().isA(new Type("boolean", 1))
!             ||  method.getReturns().isA(new Type("java.lang.Boolean"))
!             ||  method.getReturns().isA(new Type("java.lang.Boolean", 1))) {
              return "true, false";
          } else if (method.getTagByName("qtags.allowed-value") != null) {
***************
*** 66,69 ****
--- 72,83 ----
      }
  
+     public String getArray(JavaMethod method) {
+         return method.getReturns().isArray() ? "yes" : "no";
+     }
+     
+     public String getArrayToken(JavaMethod method) {
+         return method.getReturns().isArray() ? qTagUtils.getTokenizer(method) 
: "";
+     }
+     
      public String getDescription(JavaMethod method) {
          return notNull(method.getComment());
***************
*** 71,74 ****
--- 85,90 ----
  
      public Collection getMethodsWithTagParameters(JavaClass javaClass) {
+         return qTagUtils.getMethods(javaClass);
+         /*
          LinkedList methods = new LinkedList();
          JavaMethod[] allMethods = javaClass.getMethods(true);
***************
*** 81,84 ****
--- 97,101 ----
  
          return methods;
+         */
      }
  
***************
*** 87,90 ****
--- 104,108 ----
      }
  
+     /*
      private boolean hasTagParameters(JavaMethod method) {
          String parent = method.getParentClass().getFullyQualifiedName();
***************
*** 92,95 ****
--- 110,114 ----
          !(parent.equals("com.thoughtworks.qdox.model.DocletTag"));
      }
+     */
  
      private String notNull(String s) {



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
xdoclet-plugins-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits

Reply via email to