You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2009/10/20 11:08:55 UTC

svn commit: r827012 - in /myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt: TaglibAnnotationVisitor.java TobagoAnnotationVisitor.java

Author: lofwyr
Date: Tue Oct 20 09:08:54 2009
New Revision: 827012

URL: http://svn.apache.org/viewvc?rev=827012&view=rev
Log:
TOBAGO-637
  reorder the tags: the display tag must be the first

Modified:
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java?rev=827012&r1=827011&r2=827012&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java Tue Oct 20 09:08:54 2009
@@ -106,6 +106,15 @@
         "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd");
       taglib.setAttribute("version", "2.1");
     }
+    String description = packageDeclaration.getDocComment();
+    if (description != null) {
+      addLeafCDATAElement(description, "description", taglib, document);
+    }
+    String displayName = taglibAnnotation.displayName();
+    if (displayName == null || displayName.length() == 0) {
+      displayName = taglibAnnotation.shortName();
+    }
+    addLeafTextElement(displayName, "display-name", taglib, document);
     if (is12()) {
       addLeafTextElement("1.2", "tlib-version", taglib, document);
     } else {
@@ -116,15 +125,6 @@
     }
     addLeafTextElement(taglibAnnotation.shortName(), "short-name", taglib, document);
     addLeafTextElement(taglibAnnotation.uri(), "uri", taglib, document);
-    String displayName = taglibAnnotation.displayName();
-    if (displayName==null||displayName.length()==0) {
-      displayName = taglibAnnotation.shortName();
-    }
-    addLeafTextElement(displayName, "display-name", taglib, document);
-    String description = packageDeclaration.getDocComment();
-    if (description != null) {
-      addLeafCDATAElement(description, "description", taglib, document);
-    }
     for (String listenerClass : taglibAnnotation.listener()) {
       Element listener = document.createElement("listener");
       // TODO check listenerClass implements ServletContextListener !!
@@ -224,6 +224,7 @@
       Declaration decl, Tag annotationTag, String className, Document document,
       boolean deprecated) {
     Element tagElement = document.createElement("tag");
+    addDescription(decl, tagElement, document, deprecated);
     if (deprecated) {
       addLeafTextElement(annotationTag.deprecatedName(), "name", tagElement, document);
     } else {
@@ -249,7 +250,6 @@
       }
     }
     addLeafTextElement(bodyContent.toString(), "body-content", tagElement, document);
-    addDescription(decl, tagElement, document, deprecated);
     return tagElement;
   }
 
@@ -428,6 +428,7 @@
           attributeStr = tagAttribute.name();
         }
         checkAttributeDuplicates(attributeStr);
+        addDescription(d, attribute, document, false);
         addLeafTextElement(attributeStr, "name", attribute, document);
 
         addLeafTextElement(Boolean.toString(tagAttribute.required()), "required", attribute, document);
@@ -467,7 +468,6 @@
         if (tagAttribute.rtexprvalue()) {
           addLeafTextElement(Boolean.toString(tagAttribute.rtexprvalue()), "rtexprvalue", attribute, document);
         }
-        addDescription(d, attribute, document, false);
         tagElement.appendChild(attribute);
       } else {
         throw new IllegalArgumentException("Only setter allowed found: " + simpleName);

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java?rev=827012&r1=827011&r2=827012&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java Tue Oct 20 09:08:54 2009
@@ -79,6 +79,7 @@
   @Override
   protected Element createTag(Declaration decl, Tag tag, String className, Document document, boolean deprecated) {
     Element tagElement = document.createElement("tag");
+    addDescription(decl, tagElement, document, false);
     addLeafTextElement(tag.name(), "name", tagElement, document);
     addLeafTextElement(className, "tag-class", tagElement, document);
 
@@ -115,9 +116,6 @@
       tagElement.appendChild(bodyContentDescription);
     }
 
-
-    addDescription(decl, tagElement, document, false);
-
     return tagElement;
   }
 
@@ -134,6 +132,7 @@
       String simpleName = method.getSimpleName();
       if (simpleName.startsWith("set")) {
         Element attribute = document.createElement("attribute");
+        addDescription(method, attribute, document);
         addLeafTextElement(simpleName.substring(3, 4).toLowerCase(Locale.ENGLISH)
             + simpleName.substring(4), "name", attribute, document);
         addLeafTextElement(Boolean.toString(tagAttribute.required()), "required", attribute, document);
@@ -157,7 +156,6 @@
           }
 
         }
-        addDescription(method, attribute, document);
 
         tagElement.appendChild(attribute);
       } else {