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/10/19 16:11:03 UTC
svn commit: r826680 - in
/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main:
java/org/apache/myfaces/tobago/apt/
java/org/apache/myfaces/tobago/apt/generate/
resources/org/apache/myfaces/tobago/apt/
Author: lofwyr
Date: Mon Oct 19 14:11:02 2009
New Revision: 826680
URL: http://svn.apache.org/viewvc?rev=826680&view=rev
Log:
Code Generation: Adding information of the source class and the used templated to the java doc of the generated class.
Modified:
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/RendererInfo.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/renderer.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java Mon Oct 19 14:11:02 2009
@@ -122,7 +122,7 @@
Tag tag = decl.getAnnotation(Tag.class);
TagGeneration tagGeneration = decl.getAnnotation(TagGeneration.class);
- TagInfo tagInfo = new TagInfo(tagGeneration.className());
+ TagInfo tagInfo = new TagInfo(decl.getQualifiedName(), tagGeneration.className());
tagInfo.setSuperClass(decl.getQualifiedName());
StringTemplate stringTemplate = tagAbstractStringTemplateGroup.getInstanceOf("tag");
stringTemplate.setAttribute("tagInfo", tagInfo);
@@ -140,7 +140,7 @@
if (tag != null) {
String className = "org.apache.myfaces.tobago.internal.taglib." + StringUtils.capitalize(tag.name()) + "Tag";
- TagInfo tagInfo = new TagInfo(className, componentTag.rendererType());
+ TagInfo tagInfo = new TagInfo(decl.getQualifiedName(), className, componentTag.rendererType());
for (PropertyInfo property : properties) {
if (property.isTagAttribute()) {
tagInfo.getProperties().add(property);
@@ -169,7 +169,8 @@
if (componentTag.generate()) {
StringTemplate componentStringTemplate = componentStringTemplateGroup.getInstanceOf("component");
- ComponentInfo componentInfo = new ComponentInfo(componentTag.uiComponent(), componentTag.rendererType());
+ ComponentInfo componentInfo
+ = new ComponentInfo(decl.getQualifiedName(), componentTag.uiComponent(), componentTag.rendererType());
componentInfo.setSuperClass(componentTag.uiComponentBaseClass());
componentInfo.setComponentFamily(componentTag.componentFamily());
List<String> elMethods = Collections.emptyList();
@@ -310,7 +311,7 @@
return;
}
renderer.add(className);
- RendererInfo info = new RendererInfo(className, rendererType);
+ RendererInfo info = new RendererInfo(decl.getQualifiedName(), className, rendererType);
boolean ajaxEnabled =
Arrays.asList(componentTag.interfaces()).contains("org.apache.myfaces.tobago.ajax.api.AjaxComponent");
if (componentTag.isLayout()) {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ClassInfo.java Mon Oct 19 14:11:02 2009
@@ -17,8 +17,8 @@
* limitations under the License.
*/
-import java.util.Set;
import java.util.HashSet;
+import java.util.Set;
public class ClassInfo {
@@ -27,8 +27,10 @@
private Imports imports;
private String superClassName;
private Set<String> interfaces = new HashSet<String>();
+ private String sourceClass;
- public ClassInfo(String qualifiedName) {
+ public ClassInfo(String sourceClass, String qualifiedName) {
+ this.sourceClass = sourceClass;
this.className = ClassUtils.getSimpleName(qualifiedName);
this.packageName = ClassUtils.getPackageName(qualifiedName);
imports = new Imports(packageName);
@@ -82,4 +84,7 @@
return interfaces;
}
+ public String getSourceClass() {
+ return sourceClass;
+ }
}
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/ComponentInfo.java Mon Oct 19 14:11:02 2009
@@ -25,8 +25,8 @@
private boolean invokeOnComponent;
private boolean messages;
- public ComponentInfo(String qualifiedName, String rendererName) {
- super(qualifiedName, rendererName);
+ public ComponentInfo(String sourceClass, String qualifiedName, String rendererName) {
+ super(sourceClass, qualifiedName, rendererName);
}
public boolean isInvokeOnComponent() {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/RendererInfo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/RendererInfo.java?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/RendererInfo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/RendererInfo.java Mon Oct 19 14:11:02 2009
@@ -20,12 +20,12 @@
public class RendererInfo extends ClassInfo {
private String rendererName;
- public RendererInfo(String qualifiedName) {
- super(qualifiedName);
+ public RendererInfo(String sourceClass, String qualifiedName) {
+ super(sourceClass, qualifiedName);
}
- public RendererInfo(String qualifiedName, String rendererName) {
- super(qualifiedName);
+ public RendererInfo(String sourceClass, String qualifiedName, String rendererName) {
+ super(sourceClass, qualifiedName);
this.rendererName = rendererName;
}
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/generate/TagInfo.java Mon Oct 19 14:11:02 2009
@@ -29,12 +29,12 @@
private PropertyInfo bodyContent;
private boolean checkBodyContent;
- public TagInfo(String qualifiedName, String rendererName) {
- super(qualifiedName, rendererName);
+ public TagInfo(String sourceClass, String qualifiedName, String rendererName) {
+ super(sourceClass, qualifiedName, rendererName);
}
- public TagInfo(String qualifiedName) {
- super(qualifiedName);
+ public TagInfo(String sourceClass, String qualifiedName) {
+ super(sourceClass, qualifiedName);
}
public PropertyInfo getBodyContent() {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.1.stg Mon Oct 19 14:11:02 2009
@@ -18,9 +18,7 @@
*/
component(componentInfo) ::= <<
-//------------------ GENERATED CODE (do not modify!) --------------------
-
-package <componentInfo.packageName>;
+// ---------- Attention: Generated code, please do not modify! -----------
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -39,8 +37,14 @@
* limitations under the License.
*/
+package <componentInfo.packageName>;
+
<componentInfo.imports:import(); separator="\n">
+/**
+ * UIComponent class, generated from template {@code component1.1.stg} with class
+ * {@link <componentInfo.sourceClass>}.
+ */
public class <componentInfo.className>
extends <componentInfo.superClassName> <first(componentInfo.interfaces):{ n | implements <n>}><rest(componentInfo.interfaces):{ n |, <n>}> {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/component1.2.stg Mon Oct 19 14:11:02 2009
@@ -18,9 +18,7 @@
*/
component(componentInfo) ::= <<
-//------------------ GENERATED CODE (do not modify!) --------------------
-
-package <componentInfo.packageName>;
+// ---------- Attention: Generated code, please do not modify! -----------
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -39,8 +37,14 @@
* limitations under the License.
*/
+package <componentInfo.packageName>;
+
<componentInfo.imports:import(); separator="\n">
+/**
+ * UIComponent class, generated from template {@code component1.2.stg} with class
+ * {@link <componentInfo.sourceClass>}.
+ */
public class <componentInfo.className>
extends <componentInfo.superClassName> <first(componentInfo.interfaces):{ n | implements <n>}><rest(componentInfo.interfaces):{ n |, <n>}> {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/renderer.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/renderer.stg?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/renderer.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/renderer.stg Mon Oct 19 14:11:02 2009
@@ -18,9 +18,7 @@
*/
renderer(renderInfo) ::= <<
-//------------------ GENERATED CODE (do not modify!) --------------------
-
-package <renderInfo.packageName>;
+// ---------- Attention: Generated code, please do not modify! -----------
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -39,8 +37,14 @@
* limitations under the License.
*/
+package <renderInfo.packageName>;
+
<renderInfo.imports:import(); separator="\n">
+/**
+ * Renderer class, generated from template {@code renderer.stg} with class
+ * {@link <rendererInfo.sourceClass>}.
+ */
public final class <renderInfo.className>
extends <renderInfo.superClassName> <first(renderInfo.interfaces):{ n | implements <n> }><rest(renderInfo.interfaces):{ n | , <n> }> {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.1.stg Mon Oct 19 14:11:02 2009
@@ -19,7 +19,7 @@
tag(tagInfo) ::= <<
-//------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+// ---------- Attention: Generated code, please do not modify! -----------
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +42,10 @@
<tagInfo.imports:import(); separator="\n">
+/**
+ * JSP Tag class, generated from template {@code tag1.1.stg} with class
+ * {@link <tagInfo.sourceClass>}.
+ */
public final class <tagInfo.className> extends <tagInfo.superClassName> {
private static final Log LOG = LogFactory.getLog(<tagInfo.className>.class);
<tagInfo.properties:field(); separator="\n">
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tag1.2.stg Mon Oct 19 14:11:02 2009
@@ -19,7 +19,7 @@
tag(tagInfo) ::= <<
-//------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+// ---------- Attention: Generated code, please do not modify! -----------
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +42,10 @@
<tagInfo.imports:import(); separator="\n">
+/**
+ * JSP Tag class, generated from template {@code tag1.2.stg} with class
+ * {@link <tagInfo.sourceClass>}.
+ */
public final class <tagInfo.className> extends <tagInfo.superClassName> {
private static final Log LOG = LogFactory.getLog(<tagInfo.className>.class);
<tagInfo.properties:field(); separator="\n">
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.1.stg Mon Oct 19 14:11:02 2009
@@ -19,7 +19,7 @@
tag(tagInfo) ::= <<
-//------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+// ---------- Attention: Generated code, please do not modify! -----------
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +42,10 @@
<tagInfo.imports:import(); separator="\n">
+/**
+ * JSP Tag class, generated from template {@code tagAbstract1.1.stg} with class
+ * {@link <tagInfo.sourceClass>}.
+ */
public class <tagInfo.className> extends <tagInfo.superClassName> {
private static final Log LOG = LogFactory.getLog(<tagInfo.className>.class);
<tagInfo.properties:field(); separator="\n">
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg?rev=826680&r1=826679&r2=826680&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/resources/org/apache/myfaces/tobago/apt/tagAbstract1.2.stg Mon Oct 19 14:11:02 2009
@@ -19,7 +19,7 @@
tag(tagInfo) ::= <<
-//------------------ GENERATED CODE BEGIN (do not modify!) --------------------
+// ---------- Attention: Generated code, please do not modify! -----------
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +42,10 @@
<tagInfo.imports:import(); separator="\n">
+/**
+ * JSP Tag class, generated from template {@code tagAbstract1.2.stg} with class
+ * {@link <tagInfo.sourceClass>}.
+ */
public class <tagInfo.className> extends <tagInfo.superClassName> {
private static final Log LOG = LogFactory.getLog(<tagInfo.className>.class);
<tagInfo.properties:field(); separator="\n">