myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1433376 - /myfaces/tobago/branches/tobago-1.5.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
Date Tue, 15 Jan 2013 12:28:00 GMT
Author: lofwyr
Date: Tue Jan 15 12:28:00 2013
New Revision: 1433376

URL: http://svn.apache.org/viewvc?rev=1433376&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/branches/tobago-1.5.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java?rev=1433376&r1=1433375&r2=1433376&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
(original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
Tue Jan 15 12:28:00 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);
@@ -499,7 +500,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);



Mime
View raw message