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/08/12 18:34:54 UTC
svn commit: r803584 -
/myfaces/tobago/branches/tobago-1.0.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
Author: lofwyr
Date: Wed Aug 12 16:34:53 2009
New Revision: 803584
URL: http://svn.apache.org/viewvc?rev=803584&view=rev
Log:
TOBAGO-763: Documentation should contain the default values and (internal) types of the tag attributes
Modified:
myfaces/tobago/branches/tobago-1.0.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
Modified: myfaces/tobago/branches/tobago-1.0.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.0.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java?rev=803584&r1=803583&r2=803584&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java Wed Aug 12 16:34:53 2009
@@ -26,6 +26,7 @@
import com.sun.mirror.declaration.PackageDeclaration;
import com.sun.mirror.type.InterfaceType;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
import org.apache.myfaces.tobago.apt.annotation.BodyContent;
import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
@@ -35,6 +36,7 @@
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
import org.apache.myfaces.tobago.apt.annotation.Taglib;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -49,6 +51,7 @@
import java.io.File;
import java.io.IOException;
import java.io.Writer;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Locale;
@@ -281,6 +284,16 @@
if (componentTag != null) {
description.append(createDescription(componentTag));
}
+ UIComponentTagAttribute attributeTag = decl.getAnnotation(UIComponentTagAttribute.class);
+ if (attributeTag != null) {
+ if (null != attributeTag.type() && attributeTag.type().length > 0) {
+ description.append("<br />Type: <code>" + (attributeTag.type().length == 1
+ ? attributeTag.type()[0] : Arrays.toString(attributeTag.type())) + "</code>");
+ }
+ if (StringUtils.isNotEmpty(attributeTag.defaultValue())) {
+ description.append("<br />Default: <code>" + attributeTag.defaultValue() + "</code>");
+ }
+ }
ExtensionTag extensionTag = decl.getAnnotation(ExtensionTag.class);
if (extensionTag != null) {
String baseName = extensionTag.baseClassName();