Permalink
Browse files

Adding some formatting on output and text if no description found

  • Loading branch information...
1 parent 9f5e2e9 commit 65e32645a5e53e44a0fd5f9d4e5058d5cdae7f6c attonnnn committed Sep 28, 2010
View
4 src/main/java/fr/exanpe/tapestry/tldgen/taglib/builder/StructureBuilder.java
@@ -189,9 +189,9 @@ private Attribute buildAttributeFromField(Field field)
private String buildParameterDescription(Parameter p){
StringBuilder builder = new StringBuilder();
-
+
builder.append(TapestryTldGenConstants.ALLOW_NULL_TXT).append(p.allowNull()).append("\n");
- builder.append(TapestryTldGenConstants.DEFAULT_PREFIX_TXT).append(p.defaultPrefix()).append("\n");
+ builder.append(TapestryTldGenConstants.DEFAULT_TLD_SEPARATOR).append(TapestryTldGenConstants.DEFAULT_PREFIX_TXT).append(p.defaultPrefix()).append("\n");
return builder.toString();
}
View
7 src/main/java/fr/exanpe/tapestry/tldgen/utils/JavadocBeanMerger.java
@@ -16,6 +16,8 @@
package fr.exanpe.tapestry.tldgen.utils;
+import org.apache.commons.lang.StringUtils;
+
import fr.exanpe.tapestry.tldgen.javadoc.mapping.ComponentBean;
import fr.exanpe.tapestry.tldgen.javadoc.mapping.ComponentsInfoBean;
import fr.exanpe.tapestry.tldgen.javadoc.mapping.ParameterBean;
@@ -64,7 +66,10 @@ public static void mergeToTaglib(Taglib taglib, ComponentsInfoBean infos)
description = getParentAttributeDescription(comp, a, infos);
}
- a.setDescription(description+"\n"+a.getParameterDescription());
+ if(StringUtils.isEmpty(description))
+ description = TapestryTldGenConstants.NO_DESCRIPTION;
+
+ a.setDescription(description+TapestryTldGenConstants.DEFAULT_TLD_SEPARATOR+a.getParameterDescription());
}
}
}
View
14 src/main/java/fr/exanpe/tapestry/tldgen/utils/TapestryTldGenConstants.java
@@ -65,12 +65,22 @@
{ "base", "components" };
/**
- * Allow null String in generation
+ * Allow null String in description
*/
public static final String ALLOW_NULL_TXT = "Allow null : ";
/**
- * Allow null String in generation
+ * Default prefix in description
*/
public static final String DEFAULT_PREFIX_TXT = "Default prefix : ";
+
+ /**
+ * Separator in tld for multiple information in a single tag
+ */
+ public static final String DEFAULT_TLD_SEPARATOR = " - ";
+
+ /**
+ * Text displayed when no description has been found
+ */
+ public static final String NO_DESCRIPTION = "No description found";
}

0 comments on commit 65e3264

Please sign in to comment.