Return-Path: X-Original-To: apmail-myfaces-commits-archive@www.apache.org Delivered-To: apmail-myfaces-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5667DB1D for ; Tue, 15 Jan 2013 12:28:31 +0000 (UTC) Received: (qmail 91622 invoked by uid 500); 15 Jan 2013 12:28:31 -0000 Delivered-To: apmail-myfaces-commits-archive@myfaces.apache.org Received: (qmail 91362 invoked by uid 500); 15 Jan 2013 12:28:24 -0000 Mailing-List: contact commits-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list commits@myfaces.apache.org Received: (qmail 91326 invoked by uid 99); 15 Jan 2013 12:28:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2013 12:28:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2013 12:28:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C537B23889E2; Tue, 15 Jan 2013 12:28:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@myfaces.apache.org From: lofwyr@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130115122800.C537B23889E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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);