myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1452218 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/ tobago-extension/tobago-tag...
Date Mon, 04 Mar 2013 09:14:05 GMT
Author: lofwyr
Date: Mon Mar  4 09:14:05 2013
New Revision: 1452218

URL: http://svn.apache.org/r1452218
Log:
TOBAGO-1212: Using JSR 269: Pluggable Annotation Processing API
- cleanup

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java
    myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/package-info.java
    myfaces/tobago/trunk/tobago-extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/internal/taglib/extension/package-info.java
    myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Taglib.java
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ReferenceGenerator.java
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TldGenerator.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java?rev=1452218&r1=1452217&r2=1452218&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/package-info.java
Mon Mar  4 09:14:05 2013
@@ -1,16 +1,3 @@
-/**
- * <b>Tobago Framework Component Tag Library 1.6.x -
- * (C) Copyright 2005-2012 The Apache Software Foundation</b>
- */
-@org.apache.myfaces.tobago.apt.annotation.Taglib(
-    shortName = "tc",
-    tlibVersion = "1.6",
-    uri = "http://myfaces.apache.org/tobago/component",
-    listener = {
-        "org.apache.myfaces.tobago.webapp.TobagoServletContextListener",
-        "org.apache.myfaces.tobago.webapp.SecretSessionListener"},
-    fileName = "tobago.tld",
-    displayName = "Tobago Components 1.6.x")
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -30,4 +17,18 @@
  * under the License.
  */
 
+/**
+ * <b>Tobago Framework Component Tag Library 1.6.x -
+ * (C) Copyright 2005-2013 The Apache Software Foundation</b>
+ */
+@org.apache.myfaces.tobago.apt.annotation.Taglib(
+    shortName = "tc",
+    tlibVersion = "1.6",
+    uri = "http://myfaces.apache.org/tobago/component",
+    listener = {
+        "org.apache.myfaces.tobago.webapp.TobagoServletContextListener",
+        "org.apache.myfaces.tobago.webapp.SecretSessionListener"},
+    name = "tobago",
+    displayName = "Tobago Components 1.6.x")
+
 package org.apache.myfaces.tobago.internal.taglib.component;

Modified: myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/package-info.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/package-info.java?rev=1452218&r1=1452217&r2=1452218&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/package-info.java
(original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/internal/taglib/sandbox/package-info.java
Mon Mar  4 09:14:05 2013
@@ -1,15 +1,3 @@
-/**
- * <b>Tobago Framework Sandbox Tag Library -
- * (C) Copyright 2002-2008 The Apache Software Foundation</b>
- *
- * <b>Warning: The sandbox tag library contains unstable components.
- * Everything is subject to change without prior notice.</b>
- */
-@org.apache.myfaces.tobago.apt.annotation.Taglib(
-    shortName = "tcs",
-    uri = "http://myfaces.apache.org/tobago/sandbox",
-    fileName = "tobago-sandbox.tld", 
-    displayName = "Tobago Sandbox") 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -29,4 +17,17 @@
  * under the License.
  */
 
+/**
+ * <b>Tobago Framework Sandbox Tag Library 1.6.x -
+ * (C) Copyright 2002-2013 The Apache Software Foundation</b>
+ *
+ * <b>Warning: The sandbox tag library contains unstable components.
+ * Everything is subject to change without prior notice.</b>
+ */
+@org.apache.myfaces.tobago.apt.annotation.Taglib(
+    shortName = "tcs",
+    uri = "http://myfaces.apache.org/tobago/sandbox",
+    name = "tobago-sandbox",
+    displayName = "Tobago Sandbox 1.6.x")
+
 package org.apache.myfaces.tobago.internal.taglib.sandbox;

Modified: myfaces/tobago/trunk/tobago-extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/internal/taglib/extension/package-info.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/internal/taglib/extension/package-info.java?rev=1452218&r1=1452217&r2=1452218&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/internal/taglib/extension/package-info.java
(original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/internal/taglib/extension/package-info.java
Mon Mar  4 09:14:05 2013
@@ -1,13 +1,3 @@
-/**
- * <b>Tobago Framework Extension Tag Library 1.5.x -
- * (C) Copyright 2005-2011 The Apache Software Foundation</b>
- */
-@org.apache.myfaces.tobago.apt.annotation.Taglib(
-    shortName = "tx",
-    tlibVersion = "1.5",
-    uri = "http://myfaces.apache.org/tobago/extension",
-    fileName = "tobago-extension.tld", 
-    displayName = "Tobago Extensions 1.5.x") 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -27,4 +17,15 @@
  * under the License.
  */
 
+/**
+ * <b>Tobago Framework Extension Tag Library 1.6.x -
+ * (C) Copyright 2005-2013 The Apache Software Foundation</b>
+ */
+@org.apache.myfaces.tobago.apt.annotation.Taglib(
+    shortName = "tx",
+    tlibVersion = "1.5",
+    uri = "http://myfaces.apache.org/tobago/extension",
+    name = "tobago-extension",
+    displayName = "Tobago Extensions 1.6.x")
+
 package org.apache.myfaces.tobago.internal.taglib.extension;

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Taglib.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Taglib.java?rev=1452218&r1=1452217&r2=1452218&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Taglib.java
(original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Taglib.java
Mon Mar  4 09:14:05 2013
@@ -33,9 +33,8 @@ public @interface Taglib {
   String jspVersion() default "1.2";
   String shortName();
   String uri();
-  String fileName() default "";
+  String name();
   String displayName() default "";
   // TODO change to Class !!
   String [] listener() default {};
-
 }

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ReferenceGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ReferenceGenerator.java?rev=1452218&r1=1452217&r2=1452218&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ReferenceGenerator.java
(original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/ReferenceGenerator.java
Mon Mar  4 09:14:05 2013
@@ -38,7 +38,6 @@ import javax.lang.model.element.PackageE
 import javax.lang.model.element.TypeElement;
 import javax.tools.FileObject;
 import javax.tools.StandardLocation;
-import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerException;
@@ -71,21 +70,12 @@ public class ReferenceGenerator extends 
     info(TARGET_REFERENCE + ": " + targetReference);
   }
 
-  public void generate() throws IOException, TransformerException, ParserConfigurationException,
-      ClassNotFoundException {
-    for (PackageElement packageElement : getPackages()) {
-      Taglib taglibAnnotation = packageElement.getAnnotation(Taglib.class);
-      Document document = createTaglib(taglibAnnotation, packageElement);
-      writeTaglib(packageElement, taglibAnnotation, document);
-    }
-  }
-
   @Override
   protected void writeTaglib(PackageElement packageElement, Taglib taglibAnnotation, Document
document)
       throws IOException, TransformerException {
     Writer writer = null;
     try {
-      final String file = taglibAnnotation.fileName().substring(0, taglibAnnotation.fileName().length()
- 3) + "xml";
+      final String file = taglibAnnotation.name() + ".xml";
       final String name = (StringUtils.isNotBlank(targetReference) ? targetReference + '/'
: "")
           + packageElement.getQualifiedName().toString().replace('.', '/') + '/' + file;
       final FileObject resource = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT,
"", name);

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TldGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TldGenerator.java?rev=1452218&r1=1452217&r2=1452218&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TldGenerator.java
(original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TldGenerator.java
Mon Mar  4 09:14:05 2013
@@ -150,7 +150,7 @@ public class TldGenerator extends Abstra
     Writer writer = null;
     try {
       final String name = (StringUtils.isNotBlank(targetTld) ? targetTld + '/' : "")
-          + packageElement.getQualifiedName().toString().replace('.', '/') + '/' + taglibAnnotation.fileName();
+          + packageElement.getQualifiedName().toString().replace('.', '/') + '/' + taglibAnnotation.name()
+ ".tld";
       final FileObject resource = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT,
"", name);
       info("Writing to file: " + resource.toUri());
       writer = resource.openWriter();



Mime
View raw message