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 2013/01/15 13:28:48 UTC

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

Author: lofwyr
Date: Tue Jan 15 12:28:48 2013
New Revision: 1433377

URL: http://svn.apache.org/viewvc?rev=1433377&view=rev
Log:
TOBAGO-1222: Generated code should use sorted items
 - fixing order of the nodes inside a node to respect the XML schema

Modified:
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.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=1433377&r1=1433376&r2=1433377&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 Jan 15 12:28:48 2013
@@ -109,6 +109,15 @@ public class TaglibAnnotationVisitor ext
         "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 (isMinium12()) {
       addLeafTextElement("1.2", "tlib-version", taglib, document);
     } else {
@@ -119,15 +128,6 @@ public class TaglibAnnotationVisitor ext
     }
     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 !!
@@ -225,6 +225,7 @@ public class TaglibAnnotationVisitor ext
   protected Element createTag(
       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 {
@@ -248,7 +249,6 @@ public class TaglibAnnotationVisitor ext
       }
     }
     addLeafTextElement(bodyContent.toString(), "body-content", tagElement, document);
-    addDescription(decl, tagElement, document, deprecated);
     return tagElement;
   }
 
@@ -458,6 +458,7 @@ public class TaglibAnnotationVisitor ext
           attributeStr = tagAttribute.name();
         }
         checkAttributeDuplicates(attributeStr);
+        addDescription(d, attribute, document, false);
         addLeafTextElement(attributeStr, "name", attribute, document);
 
         addLeafTextElement(Boolean.toString(tagAttribute.required()), "required", attribute, document);
@@ -495,7 +496,6 @@ public class TaglibAnnotationVisitor ext
         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);