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-serv21143/src/main/java/org/xdoclet/plugin/qtags/confluence

Modified Files:
        QTagConfluencePlugin.java 
Log Message:
Reformating with Jalopy

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.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** QTagConfluencePlugin.java   16 Jan 2005 19:21:43 -0000      1.7
--- QTagConfluencePlugin.java   31 May 2005 11:28:56 -0000      1.8
***************
*** 1,17 ****
  package org.xdoclet.plugin.qtags.confluence;
  
! import com.thoughtworks.qdox.model.DocletTag;
! import com.thoughtworks.qdox.model.JavaClass;
! import com.thoughtworks.qdox.model.JavaMethod;
! import com.thoughtworks.qdox.model.Type;
  import org.generama.QDoxCapableMetadataProvider;
  import org.generama.VelocityTemplateEngine;
  import org.generama.WriterMapper;
  import org.xdoclet.plugin.qtags.AbstractQTagsPlugin;
! import java.util.Collection;
! import java.util.LinkedList;
  
  /**
!  * Generates confluence documentation for qtags. This plugin is integgrated 
in 
   * plugin compilation.
   *
--- 1,25 ----
+ /*
+  * Copyright (c) 2003
+  * XDoclet Team
+  * All rights reserved.
+  */
  package org.xdoclet.plugin.qtags.confluence;
  
! import java.util.Collection;
! import java.util.LinkedList;
! 
  import org.generama.QDoxCapableMetadataProvider;
  import org.generama.VelocityTemplateEngine;
  import org.generama.WriterMapper;
+ 
  import org.xdoclet.plugin.qtags.AbstractQTagsPlugin;
! 
! import com.thoughtworks.qdox.model.DocletTag;
! import com.thoughtworks.qdox.model.JavaClass;
! import com.thoughtworks.qdox.model.JavaMethod;
! import com.thoughtworks.qdox.model.Type;
  
  /**
!  * Generates confluence documentation for qtags. This plugin is integgrated in
   * plugin compilation.
   *
***************
*** 20,56 ****
   */
  public class QTagConfluencePlugin extends AbstractQTagsPlugin {
-     
- 
      public QTagConfluencePlugin(VelocityTemplateEngine templateEngine, 
QDoxCapableMetadataProvider metadataProvider,
!                           WriterMapper writerMapper) {
          super(templateEngine, metadataProvider, writerMapper);
- 
          setFilereplace("qtags.confluence");
          setMultioutput(false);
-              
-     }
- 
-     public boolean shouldGenerate(Object metadata) {
-         return qTagUtils.shouldGenerate(metadata);
-     }
- 
-     public Collection getMethodsWithTagParameters(JavaClass javaClass) {
-         LinkedList methods = new LinkedList();
-         JavaMethod[] allMethods = javaClass.getMethods(true);
-         for (int i = 0; i < allMethods.length; i++) {
-             if (hasTagParameters(allMethods[i])) {
-                 methods.add(allMethods[i]);
-             }
-         }
-         return methods;
-     }
- 
-     
-     private boolean hasTagParameters(JavaMethod method) {
-         String parent=method.getParentClass().getFullyQualifiedName();
-         return method.isPropertyAccessor() &&
-             !(parent.equals("java.lang.Object")) &&
-             !(parent.equals("com.thoughtworks.qdox.model.DocletTag"));
- 
      }
  
--- 28,36 ----
   */
  public class QTagConfluencePlugin extends AbstractQTagsPlugin {
      public QTagConfluencePlugin(VelocityTemplateEngine templateEngine, 
QDoxCapableMetadataProvider metadataProvider,
!         WriterMapper writerMapper) {
          super(templateEngine, metadataProvider, writerMapper);
          setFilereplace("qtags.confluence");
          setMultioutput(false);
      }
  
***************
*** 58,68 ****
          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 ) {
              StringBuffer allowedValues = new StringBuffer();
              DocletTag[] tagsByName = 
method.getTagsByName("qtags.allowed-value");
              for (int i = 0; i < tagsByName.length; i++) {
!                 if (i>0) allowedValues.append(", ");
                  allowedValues.append(tagsByName[i].getValue());
              }
              return allowedValues.toString();
          } else {
--- 38,53 ----
          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) {
              StringBuffer allowedValues = new StringBuffer();
              DocletTag[] tagsByName = 
method.getTagsByName("qtags.allowed-value");
+ 
              for (int i = 0; i < tagsByName.length; i++) {
!                 if (i > 0) {
!                     allowedValues.append(", ");
!                 }
! 
                  allowedValues.append(tagsByName[i].getValue());
              }
+ 
              return allowedValues.toString();
          } else {
***************
*** 73,77 ****
      public String getDefaultValue(JavaMethod method) {
          DocletTag tag = method.getTagByName("qtags.parameter");
!         if (tag==null) return "";
  
          return notNull(tag.getNamedParameter("default"));
--- 58,65 ----
      public String getDefaultValue(JavaMethod method) {
          DocletTag tag = method.getTagByName("qtags.parameter");
! 
!         if (tag == null) {
!             return "";
!         }
  
          return notNull(tag.getNamedParameter("default"));
***************
*** 82,88 ****
      }
  
      private String notNull(String s) {
!         if (s == null) return "";
          return s;
      }
! }
--- 70,102 ----
      }
  
+     public Collection getMethodsWithTagParameters(JavaClass javaClass) {
+         LinkedList methods = new LinkedList();
+         JavaMethod[] allMethods = javaClass.getMethods(true);
+ 
+         for (int i = 0; i < allMethods.length; i++) {
+             if (hasTagParameters(allMethods[i])) {
+                 methods.add(allMethods[i]);
+             }
+         }
+ 
+         return methods;
+     }
+ 
+     public boolean shouldGenerate(Object metadata) {
+         return qTagUtils.shouldGenerate(metadata);
+     }
+ 
+     private boolean hasTagParameters(JavaMethod method) {
+         String parent = method.getParentClass().getFullyQualifiedName();
+         return method.isPropertyAccessor() && 
!(parent.equals("java.lang.Object")) &&
+         !(parent.equals("com.thoughtworks.qdox.model.DocletTag"));
+     }
+ 
      private String notNull(String s) {
!         if (s == null) {
!             return "";
!         }
! 
          return s;
      }
! }
\ No newline at end of file



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits

Reply via email to