Permalink
Browse files

Merge branch 'master' of gitproxy:exanpe/tapestry-tldgen

  • Loading branch information...
2 parents 5f97bc9 + f895dd6 commit 49c55a61fc464e1391a58402fcdbf63fa5c6aa02 attonnnn committed Oct 6, 2010
View
@@ -6,7 +6,7 @@
<version>1.1</version>
</parent>
<artifactId>tapestry-tldgen</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>TLD Generator Tool for Tapestry Components and Eclipse IDE</name>
@@ -76,9 +76,9 @@ public Taglib build(String rootPackage, String[] supportedPackages, URL[] urls)
log.debug("Creating taglib object model...");
-
- for(String subPackage : supportedPackages){
- String pkgname = rootPackage +"."+ subPackage;
+ for (String subPackage : supportedPackages)
+ {
+ String pkgname = rootPackage + "." + subPackage;
log.debug("Processing taglib for full package named : " + pkgname);
@@ -119,7 +119,6 @@ public Taglib build(String rootPackage, String[] supportedPackages, URL[] urls)
}
}
-
log.debug("Taglib object model completed");
return taglib;
}
@@ -133,8 +132,8 @@ public Taglib build(String rootPackage, String[] supportedPackages, URL[] urls)
*/
private List<Field> getFieldAnnotatedWithParameter(String rootPackage, Class<?> c)
{
- Reflections reflection = new Reflections(rootPackage, new SingleTypeFieldAnnotationScanner(c).filterResultsBy(new FilterBuilder.Include(
- Parameter.class.getCanonicalName())));
+ Reflections reflection = new Reflections(rootPackage, new SingleTypeFieldAnnotationScanner(c).filterResultsBy(new FilterBuilder.Include(Parameter.class
+ .getCanonicalName())));
Collection<String> fieldsAsString = reflection.getStore().get(SingleTypeFieldAnnotationScanner.class).values();
List<Field> fields = new ArrayList<Field>();
for (String fAsString : fieldsAsString)
@@ -155,7 +154,7 @@ private Tag buildTagFromClass(String rootPackage, Class<?> c)
{
Tag tag = new Tag();
tag.setTagClass(c.getName());
- tag.setName(c.getSimpleName());
+ tag.setName(c.getSimpleName().toLowerCase());
List<Field> fields = getFieldAnnotatedWithParameter(rootPackage, c);
@@ -178,21 +177,22 @@ private Attribute buildAttributeFromField(Field field)
log.debug("Processing Attribute : " + field.getName());
Attribute attribute = new Attribute();
- attribute.setName(StringUtils.isNotEmpty(field.getAnnotation(Parameter.class).name())?field.getAnnotation(Parameter.class).name():field.getName());
+ attribute.setName(StringUtils.isNotEmpty(field.getAnnotation(Parameter.class).name()) ? field.getAnnotation(Parameter.class).name() : field.getName());
attribute.setDeferredValue(field.getType().getName());
attribute.setRequired(field.getAnnotation(Parameter.class).required());
attribute.setParameterDescription(buildParameterDescription(field.getAnnotation(Parameter.class)));
-
+
return attribute;
}
-
- private String buildParameterDescription(Parameter p){
+
+ private String buildParameterDescription(Parameter p)
+ {
StringBuilder builder = new StringBuilder();
-
+
builder.append(TapestryTldGenConstants.ALLOW_NULL_TXT).append(p.allowNull()).append("\n");
builder.append(TapestryTldGenConstants.DEFAULT_TLD_SEPARATOR).append(TapestryTldGenConstants.DEFAULT_PREFIX_TXT).append(p.defaultPrefix()).append("\n");
-
+
return builder.toString();
}
}
@@ -41,9 +41,8 @@
/**
* Text displaying a generated by comment
*/
- public static final String GENERATED_BY = "<!-- Generated by tapestry-tldgen - http://exanpe.free.fr/tapestry-tldgen/-->";
+ public static final String GENERATED_BY = "<!-- Generated by tapestry-tldgen - http://exanpe.free.fr/tapestry-tldgen/ -->";
-
/**
* xmlns for &lt;taglib&gt; tag
*/
@@ -69,22 +68,22 @@
*/
public final static String[] TAPESTRY_SUPPORTED_SUBPACKAGES = new String[]
{ "base", "components" };
-
+
/**
* Allow null String in description
*/
public static final String ALLOW_NULL_TXT = "Allow null : ";
-
+
/**
* 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 = " <br/> ";
-
+
/**
* Text displayed when no description has been found
*/
@@ -11,13 +11,21 @@
<body>
<section name="Release notes">
-
<p>
13/09/2010 : 1.0.0 : Déploiement de la première version du plugin
- </p>
- <p>
+ </p>
+ <p>
01/10/2010 : 1.1.0 : Bug corrigé sur la fusion des descriptions + ajout des informations allowNull et defaultPrefix dans la tld
</p>
+ <p>
+ 03/10/2010 : 1.1.0 : Déplacement du fichier temporaire généré par la Javadoc
+ </p>
+ <p>
+ 05/10/2010 : 1.1.0 : Ajout d'un commentaire "generated by" dans la TLD + formatage des informations sur les attributs des composants
+ </p>
+ <p>
+ 10-05-2010 : 1.1.0 : Déploiement sur le repo central Maven
+ </p>
<hr/>
</section>
@@ -55,10 +55,6 @@
<li>
Lancez un build and récupérez votre tld dans le répertoire target/
</li>
- <li>
- Le fichier tldgen-components-info.xml n'est pas à prendre en compte. Le plugin le génère simplement pour rendre disponible au plugin les informations issues de la Javadoc.
- </li>
-
</ul>
</section>
@@ -11,12 +11,20 @@
<body>
<section name="Release notes">
-
<p>
09-13-2010 : 1.0.0 : Deployment of the plugin first version
</p>
<p>
10-01-2010 : 1.1.0 : Bug fixed on description merging + adding allowNull and defaultPrefix information in tld
+ </p>
+ <p>
+ 10-03-2010 : 1.1.0 : Change temporary file retention generated by Javadoc
+ </p>
+ <p>
+ 10-05-2010 : 1.1.0 : Adding a "generated by" comment + adding some formatting to Eclipse display
+ </p>
+ <p>
+ 10-05-2010 : 1.1.0 : Deployment on Central Maven repository
</p>
<hr/>
</section>
View
@@ -55,10 +55,6 @@
<li>
Run a build and get your tld from target/ folder
</li>
- <li>
- Nevermind about the tldgen-components-info.xml file generated. We only generate it to provide Javadoc information back to the plugin.
- </li>
-
</ul>
</section>

0 comments on commit 49c55a6

Please sign in to comment.