You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2010/12/13 20:58:24 UTC

svn commit: r1045345 - in /tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src: main/java/org/apache/tiles/autotag/velocity/ test/java/org/apache/tiles/autotag/velocity/

Author: apetrelli
Date: Mon Dec 13 19:58:23 2010
New Revision: 1045345

URL: http://svn.apache.org/viewvc?rev=1045345&view=rev
Log:
TILESSB-38
Fixed tiles-autotag-velocity checkstyle.

Added:
    tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/package-info.java   (with props)
Modified:
    tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGenerator.java
    tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGenerator.java
    tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactory.java
    tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGeneratorTest.java
    tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGeneratorTest.java
    tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactoryTest.java

Modified: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGenerator.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGenerator.java?rev=1045345&r1=1045344&r2=1045345&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGenerator.java (original)
+++ tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGenerator.java Mon Dec 13 19:58:23 2010
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.tiles.autotag.velocity;
 
 import java.io.File;
@@ -8,8 +28,18 @@ import org.apache.tiles.autotag.model.Te
 import org.apache.tiles.autotag.model.TemplateSuite;
 import org.apache.velocity.app.VelocityEngine;
 
+/**
+ * Generates a Velocity directive using a template class.
+ *
+ * @version $Rev$ $Date$
+ */
 public class VelocityDirectiveGenerator extends AbstractTemplateClassGenerator {
 
+    /**
+     * Constructor.
+     *
+     * @param velocityEngine The Velocity engine.
+     */
     public VelocityDirectiveGenerator(VelocityEngine velocityEngine) {
         super(velocityEngine);
     }

Modified: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGenerator.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGenerator.java?rev=1045345&r1=1045344&r2=1045345&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGenerator.java (original)
+++ tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGenerator.java Mon Dec 13 19:58:23 2010
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.tiles.autotag.velocity;
 
 import java.io.File;
@@ -7,21 +27,37 @@ import org.apache.tiles.autotag.generate
 import org.apache.tiles.autotag.model.TemplateSuite;
 import org.apache.velocity.app.VelocityEngine;
 
+/**
+ * Generates a Velocity properties containing the list of generated user directives for future use.
+ *
+ * @version $Rev$ $Date$
+ */
 public class VelocityPropertiesGenerator extends AbstractTemplateSuiteGenerator {
 
+    /**
+     * Constructor.
+     *
+     * @param velocityEngine The Velocity engine.
+     */
     public VelocityPropertiesGenerator(VelocityEngine velocityEngine) {
         super(velocityEngine);
     }
 
-    protected String getTemplatePath(File directory, String packageName, TemplateSuite suite, Map<String, String> parameters) {
+    @Override
+    protected String getTemplatePath(File directory, String packageName,
+            TemplateSuite suite, Map<String, String> parameters) {
         return "/org/apache/tiles/autotag/velocity/velocityProperties.vm";
     }
 
-    protected String getFilename(File directory, String packageName, TemplateSuite suite, Map<String, String> parameters) {
+    @Override
+    protected String getFilename(File directory, String packageName,
+            TemplateSuite suite, Map<String, String> parameters) {
         return "velocity.properties";
     }
 
-    protected String getDirectoryName(File directory, String packageName, TemplateSuite suite, Map<String, String> parameters) {
+    @Override
+    protected String getDirectoryName(File directory, String packageName,
+            TemplateSuite suite, Map<String, String> parameters) {
         return "META-INF/";
     }
 

Modified: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactory.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactory.java?rev=1045345&r1=1045344&r2=1045345&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactory.java (original)
+++ tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactory.java Mon Dec 13 19:58:23 2010
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.tiles.autotag.velocity;
 
 import java.io.File;
@@ -7,6 +27,12 @@ import org.apache.tiles.autotag.generate
 import org.apache.tiles.autotag.generate.TemplateGeneratorFactory;
 import org.apache.velocity.app.VelocityEngine;
 
+/**
+ * Creates a template generator that generates code to build Velocity code
+ * around template classes.
+ *
+ * @version $Rev$ $Date$
+ */
 public class VelocityTemplateGeneratorFactory implements
         TemplateGeneratorFactory {
 
@@ -20,12 +46,27 @@ public class VelocityTemplateGeneratorFa
      */
     private File resourcesOutputDirectory;
 
+    /**
+     * The Velocity engine.
+     */
     private VelocityEngine velocityEngine;
 
+    /**
+     * The template generator builder.
+     */
     private TemplateGeneratorBuilder templateGeneratorBuilder;
 
+    /**
+     * Constructor.
+     *
+     * @param classesOutputDirectory The directory where classes will be generated.
+     * @param resourcesOutputDirectory The directory where velocity.properties will be written.
+     * @param velocityEngine The Velocity engine.
+     * @param templateGeneratorBuilder The template generator builder.
+     */
     public VelocityTemplateGeneratorFactory(File classesOutputDirectory,
-            File resourcesOutputDirectory, VelocityEngine velocityEngine, TemplateGeneratorBuilder templateGeneratorBuilder) {
+            File resourcesOutputDirectory, VelocityEngine velocityEngine,
+            TemplateGeneratorBuilder templateGeneratorBuilder) {
         this.classesOutputDirectory = classesOutputDirectory;
         this.resourcesOutputDirectory = resourcesOutputDirectory;
         this.velocityEngine = velocityEngine;

Added: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/package-info.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/package-info.java?rev=1045345&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/package-info.java (added)
+++ tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/package-info.java Mon Dec 13 19:58:23 2010
@@ -0,0 +1,24 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * Autotag support for Velocity.
+ */
+package org.apache.tiles.autotag.velocity;

Propchange: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/main/java/org/apache/tiles/autotag/velocity/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGeneratorTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGeneratorTest.java?rev=1045345&r1=1045344&r2=1045345&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGeneratorTest.java (original)
+++ tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityDirectiveGeneratorTest.java Mon Dec 13 19:58:23 2010
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.tiles.autotag.velocity;
 
@@ -10,7 +27,6 @@ import java.io.FileInputStream;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 
 import org.apache.commons.io.FileUtils;
@@ -32,7 +48,8 @@ import org.junit.Test;
 public class VelocityDirectiveGeneratorTest {
 
     /**
-     * Test method for {@link VelocityDirectiveGenerator#generate(File, String, TemplateSuite, TemplateClass, Map)}.
+     * Test method for
+     * {@link VelocityDirectiveGenerator#generate(File, String, TemplateSuite, TemplateClass, java.util.Map)}.
      * @throws Exception If something goes wrong.
      */
     @Test
@@ -74,7 +91,9 @@ public class VelocityDirectiveGeneratorT
 
         generator.generate(file, "org.apache.tiles.autotag.velocity.test", suite, clazz, null);
 
-        InputStream expected = getClass().getResourceAsStream("/org/apache/tiles/autotag/velocity/test/DoStuffDirective.javat");
+        InputStream expected = getClass()
+                .getResourceAsStream(
+                        "/org/apache/tiles/autotag/velocity/test/DoStuffDirective.javat");
         File effectiveFile = new File(file, "/org/apache/tiles/autotag/velocity/test/DoStuffDirective.java");
         assertTrue(effectiveFile.exists());
         InputStream effective = new FileInputStream(effectiveFile);
@@ -106,7 +125,9 @@ public class VelocityDirectiveGeneratorT
 
         generator.generate(file, "org.apache.tiles.autotag.velocity.test", suite, clazz, null);
 
-        expected = getClass().getResourceAsStream("/org/apache/tiles/autotag/velocity/test/DoStuffNoBodyDirective.javat");
+        expected = getClass()
+                .getResourceAsStream(
+                        "/org/apache/tiles/autotag/velocity/test/DoStuffNoBodyDirective.javat");
         effectiveFile = new File(file, "/org/apache/tiles/autotag/velocity/test/DoStuffNoBodyDirective.java");
         assertTrue(effectiveFile.exists());
         effective = new FileInputStream(effectiveFile);

Modified: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGeneratorTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGeneratorTest.java?rev=1045345&r1=1045344&r2=1045345&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGeneratorTest.java (original)
+++ tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityPropertiesGeneratorTest.java Mon Dec 13 19:58:23 2010
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.tiles.autotag.velocity;
 
@@ -10,7 +27,6 @@ import java.io.FileInputStream;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 
 import org.apache.commons.io.FileUtils;
@@ -32,7 +48,9 @@ import org.junit.Test;
 public class VelocityPropertiesGeneratorTest {
 
     /**
-     * Test method for {@link org.apache.tiles.autotag.velocity.VelocityPropertiesGenerator#generate(java.io.File, java.lang.String, org.apache.tiles.autotag.model.TemplateSuite, Map)}.
+     * Test method for
+     * {@link org.apache.tiles.autotag.velocity.VelocityPropertiesGenerator
+     * #generate(File, String, TemplateSuite, java.util.Map)}.
      * @throws Exception If something goes wrong.
      */
     @Test

Modified: tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactoryTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactoryTest.java?rev=1045345&r1=1045344&r2=1045345&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactoryTest.java (original)
+++ tiles/sandbox/trunk/tiles-autotag/tiles-autotag-velocity/src/test/java/org/apache/tiles/autotag/velocity/VelocityTemplateGeneratorFactoryTest.java Mon Dec 13 19:58:23 2010
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.tiles.autotag.velocity;
 
@@ -38,7 +55,9 @@ public class VelocityTemplateGeneratorFa
         expect(builder.build()).andReturn(generator);
 
         replay(classesOutputDirectory, resourcesOutputDirectory, velocityEngine, builder, generator);
-        VelocityTemplateGeneratorFactory factory = new VelocityTemplateGeneratorFactory(classesOutputDirectory, resourcesOutputDirectory, velocityEngine, builder);
+        VelocityTemplateGeneratorFactory factory = new VelocityTemplateGeneratorFactory(
+                classesOutputDirectory, resourcesOutputDirectory,
+                velocityEngine, builder);
         assertSame(generator, factory.createTemplateGenerator());
         verify(classesOutputDirectory, resourcesOutputDirectory, velocityEngine, builder, generator);
     }