Author: alexsmirnov
Date: 2010-02-09 19:39:52 -0500 (Tue, 09 Feb 2010)
New Revision: 16438
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/component.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTagGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTagGeneratorTest.xml
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/freemarker/
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTaglibGeneratorTest.xml
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Source.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/validator.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/RunnerTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/AnnotationProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ModelBeanTest.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
Log:
https://jira.jboss.org/jira/browse/RF-8360
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -65,9 +65,9 @@
private Charset charset = Charset.defaultCharset();
- private Map<StandardOutputFolders, FileManager> outputFolders =
Maps.newEnumMap(StandardOutputFolders.class);
+ private Map<Outputs, FileManager> outputFolders =
Maps.newEnumMap(Outputs.class);
- private Map<StandardSources,FileManager> sources =
Maps.newEnumMap(StandardSources.class);
+ private Map<Sources,FileManager> sources = Maps.newEnumMap(Sources.class);
private LibraryBuilder libraryBuilder;
@@ -76,11 +76,11 @@
public Generator() {
EmptyFileManager emptyFileManager = new EmptyFileManager();
- for (StandardSources source : StandardSources.values()) {
+ for (Sources source : Sources.values()) {
sources.put(source, emptyFileManager);
}
- for (StandardOutputFolders output : StandardOutputFolders.values()) {
+ for (Outputs output : Outputs.values()) {
outputFolders.put(output, emptyFileManager);
}
}
@@ -94,11 +94,11 @@
this.log = log;
}
- public void addOutputFolder(StandardOutputFolders type, File outputFolder) {
+ public void addOutputFolder(Outputs type, File outputFolder) {
this.outputFolders.put(type, new OutputFileManager(outputFolder));
}
- public void addSources(StandardSources type, Iterable<File> files,
Iterable<File> folders){
+ public void addSources(Sources type, Iterable<File> files, Iterable<File>
folders){
this.sources.put(type, new SourceFileManager(files, folders));
}
@@ -150,10 +150,10 @@
bind(Logger.class).toInstance(log);
bind(Locale.class).toInstance(locale);
bind(Charset.class).toInstance(charset);
- for (Map.Entry<StandardOutputFolders, FileManager> entry :
outputFolders.entrySet()) {
- bind(FileManager.class).annotatedWith(new
OutputFolderImpl(entry.getKey())).toInstance(entry.getValue());
+ for (Map.Entry<Outputs, FileManager> entry : outputFolders.entrySet())
{
+ bind(FileManager.class).annotatedWith(new
OutputImpl(entry.getKey())).toInstance(entry.getValue());
}
- for (Map.Entry<StandardSources, FileManager> entry :
sources.entrySet()) {
+ for (Map.Entry<Sources, FileManager> entry : sources.entrySet()) {
bind(FileManager.class).annotatedWith(new
SourceImpl(entry.getKey())).toInstance(entry.getValue());
}
bind(NamingConventions.class).to(RichFacesConventions.class);
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java (from
rev 16436,
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.cdk;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import com.google.inject.BindingAnnotation;
+
+/**
+ * @author asmirnov
+ * @version $Id$
+ *
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
+public @interface Output {
+ public Outputs value();
+}
Property changes on:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Deleted:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.cdk;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import com.google.inject.BindingAnnotation;
-
-/**
- * @author asmirnov
- * @version $Id$
- *
- */
-(a)Retention(RetentionPolicy.RUNTIME)
-@BindingAnnotation
-public @interface OutputFolder {
- public StandardOutputFolders value();
-}
Deleted:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,41 +0,0 @@
-package org.richfaces.cdk;
-
-import java.lang.annotation.Annotation;
-
-
-public class OutputFolderImpl implements OutputFolder {
-
- private final StandardOutputFolders value;
-
- public OutputFolderImpl(OutputFolder value) {
- this.value = value.value();
- }
-
- public OutputFolderImpl(StandardOutputFolders value) {
- this.value = value;
- }
-
- @Override
- public StandardOutputFolders value() {
- return value;
- }
-
- public int hashCode() {
- // This is specified in java.lang.Annotation.
- return (127 * "value".hashCode()) ^ value.hashCode();
- }
-
- public boolean equals(Object o) {
- if (!(o instanceof OutputFolder)) {
- return false;
- }
-
- OutputFolder other = (OutputFolder) o;
- return value.equals(other.value());
- }
-
- @Override
- public Class<? extends Annotation> annotationType() {
- return OutputFolder.class;
- }
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java
(from rev 16436,
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,41 @@
+package org.richfaces.cdk;
+
+import java.lang.annotation.Annotation;
+
+
+public class OutputImpl implements Output {
+
+ private final Outputs value;
+
+ public OutputImpl(Output value) {
+ this.value = value.value();
+ }
+
+ public OutputImpl(Outputs value) {
+ this.value = value;
+ }
+
+ @Override
+ public Outputs value() {
+ return value;
+ }
+
+ public int hashCode() {
+ // This is specified in java.lang.Annotation.
+ return (127 * "value".hashCode()) ^ value.hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (!(o instanceof Output)) {
+ return false;
+ }
+
+ Output other = (Output) o;
+ return value.equals(other.value());
+ }
+
+ @Override
+ public Class<? extends Annotation> annotationType() {
+ return Output.class;
+ }
+}
Property changes on:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java
(from rev 16436,
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,46 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+
+package org.richfaces.cdk;
+
+
+/**
+ * <p class="changed_added_4_0">This enumeration defines standard types
of output folders.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public enum Outputs implements OutputType {
+ JAVA_CLASSES, RESOURCES, TEST_JAVA_CLASSES, TEST_RESOURCES, DOCUMENTATION;
+
+ @Override
+ public OutputType getFolderType() {
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return name();
+ }
+}
Property changes on:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Source.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Source.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Source.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -38,5 +38,5 @@
@BindingAnnotation
@Implementation(SourceImpl.class)
public @interface Source {
- public StandardSources value();
+ public Sources value();
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceImpl.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceImpl.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceImpl.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -5,18 +5,18 @@
public class SourceImpl implements Source {
- private final StandardSources value;
+ private final Sources value;
public SourceImpl(Source value) {
this.value = value.value();
}
- public SourceImpl(StandardSources value) {
+ public SourceImpl(Sources value) {
this.value = value;
}
@Override
- public StandardSources value() {
+ public Sources value() {
return value;
}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java
(from rev 16436,
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,39 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk;
+
+
+/**
+ * <p class="changed_added_4_0">This enumeration defines standard types
for project sources.</p>
+ *
+ * @author asmirnov(a)exadel.com
+ */
+public enum Sources implements SourceType {
+ JAVA_SOURCES, FACES_CONFIGS, RENDERER_TEMPLATES;
+
+ @Override
+ public String getName() {
+ return name();
+ }
+}
Property changes on:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,46 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.richfaces.cdk;
-
-
-/**
- * <p class="changed_added_4_0">This enumeration defines standard types
of output folders.</p>
- * @author asmirnov(a)exadel.com
- *
- */
-public enum StandardOutputFolders implements OutputType {
- JAVA_CLASSES, RESOURCES, TEST_JAVA_CLASSES, TEST_RESOURCES, DOCUMENTATION;
-
- @Override
- public OutputType getFolderType() {
- return null;
- }
-
- @Override
- public String getName() {
- return name();
- }
-}
Deleted:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,68 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.richfaces.cdk;
-
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-public enum StandardOutputs implements OutputType {
- COMPONENT_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- VALIDATOR_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- CONVERTER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- BEHAVIOR_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- RENDERER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- EVENT_LISTENER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- EVENT_SOURCE_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- TAG_HANDLER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- FACES_CONFIG(StandardOutputFolders.RESOURCES),
- TAG_LIBRARY(StandardOutputFolders.RESOURCES),
- JBDS_RENDERERS(StandardOutputFolders.JAVA_CLASSES),
- XML_SCHEMA(StandardOutputFolders.RESOURCES),
- COMPONENT_TEST(StandardOutputFolders.TEST_JAVA_CLASSES);
-
- private final OutputType folderType;
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param folderType
- */
- private StandardOutputs(OutputType folderType) {
- this.folderType = folderType;
- }
-
- @Override
- public String getName() {
- return name();
- }
-
- @Override
- public OutputType getFolderType() {
- return folderType;
- }
-}
Deleted:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,39 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.cdk;
-
-
-/**
- * <p class="changed_added_4_0">This enumeration defines standard types
for project sources.</p>
- *
- * @author asmirnov(a)exadel.com
- */
-public enum StandardSources implements SourceType {
- JAVA_SOURCES, FACES_CONFIGS, RENDERER_TEMPLATES;
-
- @Override
- public String getName() {
- return name();
- }
-}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -44,10 +44,10 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.OutputFolder;
+import org.richfaces.cdk.Output;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardOutputFolders;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.Sources;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
@@ -100,11 +100,11 @@
private CdkClassLoader classPathLoader;
@Inject
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES)
+ @Output(Outputs.JAVA_CLASSES)
private FileManager outputFolder;
@Inject
- @Source(StandardSources.JAVA_SOURCES)
+ @Source(Sources.JAVA_SOURCES)
private FileManager sourceFolders;
@Inject
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -27,8 +27,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -49,7 +49,7 @@
* @see org.richfaces.cdk.CdkWriter#init(org.richfaces.cdk.CdkContext)
*/
@Inject
- public BehaviorClassGenerator(Configuration configuration, ComponentLibrary library,
@OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output) {
+ public BehaviorClassGenerator(Configuration configuration, ComponentLibrary library,
@Output(Outputs.JAVA_CLASSES) FileManager output) {
super(configuration, library, output);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -30,8 +30,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
@@ -53,7 +53,7 @@
* @see org.richfaces.cdk.CdkWriter#init(org.richfaces.cdk.CdkContext)
*/
@Inject
- public ComponentClassGenerator(Configuration configuration, ComponentLibrary library,
@OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output) {
+ public ComponentClassGenerator(Configuration configuration, ComponentLibrary library,
@Output(Outputs.JAVA_CLASSES) FileManager output) {
super(configuration, library, output);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -27,8 +27,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConverterModel;
@@ -46,7 +46,7 @@
@Inject
public ConverterClassGenerator(Configuration configuration, ComponentLibrary
library,
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output) {
+ @Output(Outputs.JAVA_CLASSES) FileManager output) {
super(configuration, library, output);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -27,8 +27,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ValidatorModel;
@@ -45,7 +45,7 @@
public class ValidatorClassGenerator extends FreeMarkerRenderer<ValidatorModel,
ComponentLibrary> implements CdkWriter {
@Inject
- public ValidatorClassGenerator(Configuration configuration, ComponentLibrary library,
@OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output) {
+ public ValidatorClassGenerator(Configuration configuration, ComponentLibrary library,
@Output(Outputs.JAVA_CLASSES) FileManager output) {
super(configuration, library, output);
}
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,49 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.generate.taglib;
+
+import org.richfaces.cdk.model.ComponentModel;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ComponentTagGenerator extends TagGeneratorBase<ComponentModel> {
+
+ @Inject
+ public ComponentTagGenerator(Configuration configuration) {
+ super(configuration);
+ }
+
+ @Override
+ protected String getTemplateName() {
+ return "taglib/component.ftl";
+ }
+
+}
Property changes on:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGenerator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -30,8 +30,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.LibraryVisitor;
import org.richfaces.cdk.model.Visitable;
@@ -63,7 +63,7 @@
@Inject
public TaglibGenerator(Configuration configuration, ComponentLibrary library,
- @OutputFolder(StandardOutputFolders.RESOURCES) FileManager output,
+ @Output(Outputs.RESOURCES) FileManager output,
Map<Class<? extends Visitable>, TagGenerator<? extends
Visitable>> tagGenerators) {
this.library = library;
this.output = output;
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -24,6 +24,7 @@
package org.richfaces.cdk.generate.taglib;
import org.richfaces.cdk.CdkWriter;
+import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.ValidatorModel;
import org.richfaces.cdk.model.Visitable;
@@ -47,7 +48,8 @@
Multibinder<CdkWriter> setBinder =
Multibinder.newSetBinder(binder(),CdkWriter.class);
setBinder.addBinding().to(TaglibGenerator.class);
MapBinder<Class<? extends Visitable>, TagGenerator<? extends
Visitable>> mapBinder = MapBinder.newMapBinder(binder(), new
TypeLiteral<Class<? extends Visitable>>(){}, new
TypeLiteral<TagGenerator<? extends Visitable>>(){});
- mapBinder.addBinding(ValidatorModel.class).to(ValidatorTaglibGenerator.class);
+ mapBinder.addBinding(ValidatorModel.class).to(ValidatorTagGenerator.class);
+ mapBinder.addBinding(ComponentModel.class).to(ComponentTagGenerator.class);
}
}
Copied:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java
(from rev 16436,
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java)
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.taglib;
+
+import java.io.File;
+
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ValidatorModel;
+import org.richfaces.cdk.model.Visitable;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+
+/**
+ * @author akolonitsky
+ * @since Jan 18, 2010
+ */
+public class ValidatorTagGenerator extends TagGeneratorBase<ValidatorModel>{
+
+
+
+
+ @Inject
+ public ValidatorTagGenerator(Configuration configuration) {
+ super(configuration);
+ }
+
+ @Override
+ protected String getTemplateName() {
+ return "taglib/validator.ftl";
+ }
+
+}
Deleted:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright , Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.cdk.generate.taglib;
-
-import java.io.File;
-
-import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
-import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
-import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.ValidatorModel;
-import org.richfaces.cdk.model.Visitable;
-
-import com.google.inject.Inject;
-
-import freemarker.template.Configuration;
-
-/**
- * @author akolonitsky
- * @since Jan 18, 2010
- */
-public class ValidatorTaglibGenerator extends TagGeneratorBase<ValidatorModel>{
-
-
-
-
- @Inject
- public ValidatorTaglibGenerator(Configuration configuration) {
- super(configuration);
- }
-
- @Override
- protected String getTemplateName() {
- return "taglib/validator.ftl";
- }
-
-}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -218,6 +218,7 @@
return tagLibrary;
}
+
// Utility methods.
/**
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -33,8 +33,8 @@
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.Property;
@@ -72,7 +72,7 @@
*/
@Inject
public RendererClassGenerator(ComponentLibrary library,
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output, Logger
log,
+ @Output(Outputs.JAVA_CLASSES) FileManager output, Logger log,
TemplateVisitorFactory<RendererClassVisitor> visitorFactory,
FreeMarkerRenderer renderer) {
this.library = library;
this.output = output;
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -37,7 +37,7 @@
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.ModelBuilder;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.EventName;
@@ -89,7 +89,7 @@
* @param sources
*/
@Inject
- public RendererTemplateParser(ComponentLibrary library, JAXB jaxbBinding, Logger log,
@Source(StandardSources.RENDERER_TEMPLATES) FileManager sources,FragmentParser
fragmentParser) {
+ public RendererTemplateParser(ComponentLibrary library, JAXB jaxbBinding, Logger log,
@Source(Sources.RENDERER_TEMPLATES) FileManager sources,FragmentParser fragmentParser) {
this.library = library;
this.jaxbBinding = jaxbBinding;
this.log = log;
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -33,7 +33,7 @@
import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.ext.EntityResolver2;
@@ -93,9 +93,9 @@
@Inject
private CdkClassLoader loader;
- @Inject @Source(StandardSources.FACES_CONFIGS)
+ @Inject @Source(Sources.FACES_CONFIGS)
private FileManager facesConfigFolders;
- @Inject @Source(StandardSources.RENDERER_TEMPLATES)
+ @Inject @Source(Sources.RENDERER_TEMPLATES)
private FileManager rendererTemplatesFolders;
/*
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -30,8 +30,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.xmlconfig.model.FacesConfigAdapter;
@@ -54,7 +54,7 @@
private JAXB jaxbBinding;
@Inject
private ComponentLibrary library;
- @Inject @OutputFolder(StandardOutputFolders.RESOURCES)
+ @Inject @Output(Outputs.RESOURCES)
private FileManager outputFileManager;
private FacesConfigAdapter libraryAdapter;
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -29,7 +29,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.ModelBuilder;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.xmlconfig.model.FacesConfigAdapter;
import org.richfaces.cdk.xmlconfig.model.FacesConfigBean;
@@ -51,7 +51,7 @@
private JAXB jaxbBinding;
@Inject
private ComponentLibrary library;
- @Inject @Source(StandardSources.FACES_CONFIGS)
+ @Inject @Source(Sources.FACES_CONFIGS)
private FileManager configFiles;
Added:
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/component.ftl
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/component.ftl
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/component.ftl 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,17 @@
+ <tag>
+ <tag-name>${type}</tag-name>
+ <component>
+ <component-type>${type}</component-type>
+ <renderer-type>${renderers[0].type}</renderer-type>
+ </component>
+
+ <#list attributes as attribute>
+ <attribute>
+ <#if attribute.description?exists>
+ <description>${attribute.description}</description>
+ </#if>
+ <name>${attribute.name}</name>
+ <type>${attribute.type}</type>
+ </attribute>
+ </#list>
+ </tag>
Modified:
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/validator.ftl
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/validator.ftl 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/validator.ftl 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,7 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
-<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
<tag>
<tag-name>${validatorClass}</tag-name>
<validator>
@@ -9,7 +5,7 @@
<handler-class>${validatorClass}</handler-class>
</validator>
- <#list generatedAttributes as attribute>
+ <#list attributes as attribute>
<attribute>
<#if attribute.description?exists>
<description>${attribute.description}</description>
@@ -18,5 +14,4 @@
<type>${attribute.type}</type>
</attribute>
</#list>
- </tag>
-</facelet-taglib>
\ No newline at end of file
+ </tag>
\ No newline at end of file
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/RunnerTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/RunnerTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/RunnerTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -13,7 +13,7 @@
private Logger log;
@Stub
- @Source(StandardSources.JAVA_SOURCES)
+ @Source(Sources.JAVA_SOURCES)
FileManager sources;
@Test
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/AnnotationProcessorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/AnnotationProcessorTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/AnnotationProcessorTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -36,7 +36,7 @@
import org.richfaces.cdk.Source;
import org.richfaces.cdk.SourceFileManager;
import org.richfaces.cdk.SourceImpl;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.annotations.Family;
import org.richfaces.cdk.model.ComponentModel;
@@ -51,7 +51,7 @@
public abstract class AnnotationProcessorTest extends CdkTestBase {
@Inject
- @Source(StandardSources.JAVA_SOURCES)
+ @Source(Sources.JAVA_SOURCES)
protected FileManager sources;
@Mock
@@ -67,7 +67,7 @@
for (String src : sources()) {
sourceFiles.add(getJavaFile(src));
}
- binder.bind(FileManager.class).annotatedWith(new
SourceImpl(StandardSources.JAVA_SOURCES)).toInstance(
+ binder.bind(FileManager.class).annotatedWith(new
SourceImpl(Sources.JAVA_SOURCES)).toInstance(
new SourceFileManager(sourceFiles, this.testSourceDirectory));
} catch (Exception e) {
throw new RuntimeException(e);
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -41,8 +41,8 @@
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.ModelBuilder;
import org.richfaces.cdk.ModelValidator;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.Stub;
import com.google.common.collect.ImmutableList;
@@ -72,7 +72,7 @@
private CdkProcessor processor;
@Stub
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES)
+ @Output(Outputs.JAVA_CLASSES)
private FileManager output;
@Inject
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -44,8 +44,8 @@
import org.richfaces.cdk.CdkTestRunner;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.Stub;
import com.google.common.collect.ImmutableList;
@@ -72,7 +72,7 @@
Processor processor;
@Stub
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES)
+ @Output(Outputs.JAVA_CLASSES)
private FileManager output;
/**
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -35,8 +35,8 @@
import org.richfaces.cdk.CdkTestBase;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.CdkConfiguration;
import org.richfaces.cdk.freemarker.LibraryModelWrapper;
import org.richfaces.cdk.model.ClassDescription;
@@ -68,7 +68,7 @@
protected ObjectWrapper wrapper;
@Mock
- @OutputFolder(StandardOutputFolders.RESOURCES)
+ @Output(Outputs.RESOURCES)
protected FileManager output;
protected static Property addAttribute(ModelElementBase model, String attributeName,
Class<?> type, boolean generate) {
Added:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.taglib;
+
+import static org.easymock.EasyMock.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URISyntaxException;
+import java.util.Set;
+
+import javax.faces.component.UIOutput;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Validator;
+import org.easymock.EasyMock;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.cdk.As;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Mock;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.freemarker.CdkConfiguration;
+import org.richfaces.cdk.freemarker.LibraryModelWrapper;
+import org.richfaces.cdk.generate.taglib.ValidatorTagGenerator;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ComponentModel;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.ValidatorModel;
+import org.richfaces.cdk.model.Visitable;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
+import com.google.inject.Binder;
+import com.google.inject.Inject;
+import com.google.inject.TypeLiteral;
+import com.google.inject.multibindings.MapBinder;
+
+import freemarker.template.Configuration;
+import freemarker.template.ObjectWrapper;
+
+/**
+ * @author akolonitsky
+ * @since Jan 18, 2010
+ */
+(a)RunWith(CdkTestRunner.class)
+public class TaglibGeneratorTest extends TaglibTestBase {
+
+ @Inject
+ private TaglibGenerator generator;
+
+ @Mock
+ private TagGenerator<ComponentModel> mockComponentGenerator;
+
+
+ @Override
+ public void configure(Binder binder) {
+ MapBinder<Class<? extends Visitable>, TagGenerator<? extends
Visitable>> mapBinder = MapBinder.newMapBinder(binder, new TypeLiteral<Class<?
extends Visitable>>(){}, new TypeLiteral<TagGenerator<? extends
Visitable>>(){});
+// mockComponentGenerator = createMock(TagGenerator.class);
+ mapBinder.addBinding(ComponentModel.class).to(new
TypeLiteral<TagGenerator<ComponentModel>>(){});
+ }
+ /**
+ * Test method for
+ * {@link
org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}
+ * .
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testGetOutputFileComponent() throws Exception {
+ final StringWriter outputWriter = new StringWriter();
+ expect(output.createOutput(eq("META-INF/test.taglib.xml"),
anyLong())).andReturn(outputWriter);
+ ComponentModel componentModel = new ComponentModel();
+ library.getTagLibrary().setShortName("test");
+ library.getComponents().add(componentModel);
+ mockComponentGenerator.generate(componentModel, outputWriter);expectLastCall();
+ replay(output, resolver,mockComponentGenerator);
+ generator.render();
+
+ System.out.println(outputWriter);
+ verify(output, resolver,mockComponentGenerator);
+
+ checkXmlStructure(outputWriter);
+
+ // TODO validate xml by xsd
+ // validateXml(output);
+ }
+}
Property changes on:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.taglib;
+
+import static org.easymock.EasyMock.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URISyntaxException;
+import java.util.Set;
+
+import javax.faces.component.UIOutput;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Validator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.cdk.As;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Mock;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.freemarker.CdkConfiguration;
+import org.richfaces.cdk.freemarker.LibraryModelWrapper;
+import org.richfaces.cdk.generate.taglib.ValidatorTagGenerator;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.ValidatorModel;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+import freemarker.template.ObjectWrapper;
+
+/**
+ * @author akolonitsky
+ * @since Jan 18, 2010
+ */
+(a)RunWith(CdkTestRunner.class)
+public class TaglibTestBase extends CdkTestBase {
+
+
+ @Inject
+ protected ComponentLibrary library;
+
+ @Inject
+ @As(CdkConfiguration.class)
+ protected Configuration configuration;
+
+ @Inject
+ @As(LibraryModelWrapper.class)
+ protected ObjectWrapper wrapper;
+
+ @Mock
+ protected EntityResolver2 resolver;
+
+ @Mock
+ @Output(Outputs.RESOURCES)
+ protected FileManager output;
+
+ protected EventName createEvent(String name, boolean defaultEvent) {
+ EventName event = new EventName();
+ event.setName(name);
+ event.setDefaultEvent(defaultEvent);
+ return event;
+ }
+
+ protected Property createAttribute( Class<?> type, boolean generate) {
+ Property attribute = new Property();
+ attribute.setType(new ClassDescription(type));
+ attribute.setGenerate(generate);
+ return attribute;
+ }
+
+ // TODO move it in other class
+ protected void validateXml(StringWriter facesConfig) throws SAXException,
IOException, URISyntaxException {
+ InputSource is = new InputSource(new StringReader(facesConfig.toString()));
+ Validator validator = new Validator(is);
+ validator.useXMLSchema(true);
+ InputSource source =
+ new
InputSource(getJavaFile("META-INF/schema/web-facelettaglibrary_2_0.xsd").toURI().toString());
+ validator.setJAXP12SchemaSource(source);
+
+ validator.assertIsValid();
+ }
+
+ protected void checkXmlStructure(StringWriter writer) throws SAXException,
IOException {
+ Class<?> testClass = this.getClass();
+ InputStream expectedFacesConfigFile =
testClass.getResourceAsStream(testClass.getSimpleName() + ".xml");
+ if (expectedFacesConfigFile == null) {
+ return;
+ }
+
+ Diff xmlDiff = new Diff(new StringReader(writer.toString()), new
InputStreamReader(expectedFacesConfigFile));
+
+ Assert.assertTrue("XML was not similar", xmlDiff.similar());
+ }
+}
Property changes on:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTagGeneratorTest.java
(from rev 16436,
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java)
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTagGeneratorTest.java
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTagGeneratorTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.taglib;
+
+import static org.easymock.EasyMock.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URISyntaxException;
+import java.util.Set;
+
+import javax.faces.component.UIOutput;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Validator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.cdk.As;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Mock;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.freemarker.CdkConfiguration;
+import org.richfaces.cdk.freemarker.LibraryModelWrapper;
+import org.richfaces.cdk.generate.taglib.ValidatorTagGenerator;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.ValidatorModel;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+import freemarker.template.ObjectWrapper;
+
+/**
+ * @author akolonitsky
+ * @since Jan 18, 2010
+ */
+(a)RunWith(CdkTestRunner.class)
+public class ValidatorTagGeneratorTest extends TaglibTestBase {
+
+ @Inject
+ private ValidatorTagGenerator generator;
+
+
+ /**
+ * Test method for
+ * {@link
org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}
+ * .
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testGetOutputFileComponent() throws Exception {
+ final StringWriter outputWriter = new StringWriter();
+
+ ValidatorModel validator = new ValidatorModel("foo.bar", new
ClassDescription(UIOutput.class));
+ validator.setGenerate(true);
+
+ Property attribute1 = createAttribute( Object.class, true);
+ validator.getAttributes().put("testValue", attribute1);
+ Property attribute2 = createAttribute( boolean.class, true);
+ validator.getAttributes().put("testFlag", attribute2);
+ Property attribute = createAttribute(String.class, false);
+ validator.getAttributes().put("id", attribute);
+
+ Set<EventName> eventNames = attribute.getEventNames();
+ eventNames.add(createEvent("id", false));
+ eventNames.add(createEvent("action", true));
+
+ library.getValidators().add(validator);
+ replay(output, resolver);
+ generator.generate(validator, outputWriter);
+
+ System.out.println(outputWriter);
+ verify(output, resolver);
+
+ checkXmlStructure(outputWriter);
+
+ // TODO validate xml by xsd
+ // validateXml(output);
+ }
+}
Deleted:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,166 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright , Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.cdk.generate.taglib;
-
-import static org.easymock.EasyMock.*;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.URISyntaxException;
-import java.util.Set;
-
-import javax.faces.component.UIOutput;
-
-import org.custommonkey.xmlunit.Diff;
-import org.custommonkey.xmlunit.Validator;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.richfaces.cdk.As;
-import org.richfaces.cdk.CdkTestBase;
-import org.richfaces.cdk.CdkTestRunner;
-import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.Mock;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
-import org.richfaces.cdk.freemarker.CdkConfiguration;
-import org.richfaces.cdk.freemarker.LibraryModelWrapper;
-import org.richfaces.cdk.generate.taglib.ValidatorTaglibGenerator;
-import org.richfaces.cdk.model.ClassDescription;
-import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.EventName;
-import org.richfaces.cdk.model.Property;
-import org.richfaces.cdk.model.ValidatorModel;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.EntityResolver2;
-
-import com.google.inject.Inject;
-
-import freemarker.template.Configuration;
-import freemarker.template.ObjectWrapper;
-
-/**
- * @author akolonitsky
- * @since Jan 18, 2010
- */
-(a)RunWith(CdkTestRunner.class)
-public class ValidatorTaglibGeneratorTest extends CdkTestBase {
-
- @Inject
- private ValidatorTaglibGenerator generator;
-
- @Inject
- private ComponentLibrary library;
-
- @Inject
- @As(CdkConfiguration.class)
- private Configuration configuration;
-
- @Inject
- @As(LibraryModelWrapper.class)
- ObjectWrapper wrapper;
-
- @Mock
- private EntityResolver2 resolver;
-
- @Mock
- @OutputFolder(StandardOutputFolders.RESOURCES)
- private FileManager output;
-
- /**
- * Test method for
- * {@link
org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}
- * .
- *
- * @throws Exception
- */
- @Test
- public void testGetOutputFileComponent() throws Exception {
- final StringWriter outputWriter = new StringWriter();
-
- ValidatorModel validator = new ValidatorModel("foo.bar", new
ClassDescription(UIOutput.class));
- validator.setGenerate(true);
-
- addAttribute(validator, "testValue", Object.class, true);
- addAttribute(validator, "testFlag", boolean.class, true);
- Property attribute = addAttribute(validator, "id", String.class,
false);
-
- Set<EventName> eventNames = attribute.getEventNames();
- eventNames.add(getEvent("id", false));
- eventNames.add(getEvent("action", true));
-
- library.getValidators().add(validator);
- replay(output, resolver);
- generator.generate(validator, outputWriter);
-
- System.out.println(outputWriter);
- verify(output, resolver);
-
- checkXmlStructure(outputWriter);
-
- // TODO validate xml by xsd
- // validateXml(output);
- }
-
- private EventName getEvent(String name, boolean defaultEvent) {
- EventName event = new EventName();
- event.setName(name);
- event.setDefaultEvent(defaultEvent);
- return event;
- }
-
- private Property addAttribute(ValidatorModel validator, String attributeName,
Class<?> type, boolean generate) {
- Property attribute = validator.addAttribute(attributeName);
- attribute.setType(new ClassDescription(type));
- attribute.setGenerate(generate);
- return attribute;
- }
-
- // TODO move it in other class
- protected void validateXml(StringWriter facesConfig) throws SAXException,
IOException, URISyntaxException {
- InputSource is = new InputSource(new StringReader(facesConfig.toString()));
- Validator validator = new Validator(is);
- validator.useXMLSchema(true);
- InputSource source =
- new
InputSource(getJavaFile("META-INF/schema/web-facelettaglibrary_2_0.xsd").toURI().toString());
- validator.setJAXP12SchemaSource(source);
-
- validator.assertIsValid();
- }
-
- protected void checkXmlStructure(StringWriter writer) throws SAXException,
IOException {
- Class<?> testClass = this.getClass();
- InputStream expectedFacesConfigFile =
testClass.getResourceAsStream(testClass.getSimpleName() + ".xml");
- if (expectedFacesConfigFile == null) {
- return;
- }
-
- Diff xmlDiff = new Diff(new StringReader(writer.toString()), new
InputStreamReader(expectedFacesConfigFile));
-
- Assert.assertTrue("XML was not similar", xmlDiff.similar());
- }
-}
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -45,7 +45,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.EventName;
@@ -82,7 +82,7 @@
private EntityResolver2 resolver;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager templatesSource;
private RenderKitModel getRenderkitFromModel(String renderkitId) {
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -14,7 +14,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.annotations.Component;
import org.xml.sax.InputSource;
@@ -31,11 +31,11 @@
private CdkEntityResolver entityResolver;
@Mock
- @Source(StandardSources.FACES_CONFIGS)
+ @Source(Sources.FACES_CONFIGS)
private FileManager facesConfigSource;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager templatesSource;
@Override
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -37,7 +37,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.FacetModel;
@@ -73,11 +73,11 @@
JAXB jaxbBinding;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager templatesSource;
@Mock
- @Source(StandardSources.FACES_CONFIGS)
+ @Source(Sources.FACES_CONFIGS)
private FileManager configSource;
@Override
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -38,7 +38,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.Property;
import org.xml.sax.ext.EntityResolver2;
@@ -68,11 +68,11 @@
JAXB binder;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager templatesSource;
@Mock
- @Source(StandardSources.FACES_CONFIGS)
+ @Source(Sources.FACES_CONFIGS)
private FileManager configSource;
@Override
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ModelBeanTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ModelBeanTest.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ModelBeanTest.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -40,7 +40,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.xmlconfig.CdkEntityResolver;
import org.richfaces.cdk.xmlconfig.FacesConfigGenerator;
@@ -71,11 +71,11 @@
EntityResolver2 resolver;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
FileManager templatesSource;
@Mock
- @Source(StandardSources.FACES_CONFIGS)
+ @Source(Sources.FACES_CONFIGS)
FileManager configSource;
@Override
Copied: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib (from
rev 16436,
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/freemarker)
Added:
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
+
+</facelet-taglib>
Property changes on:
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTagGeneratorTest.xml
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTagGeneratorTest.xml
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTagGeneratorTest.xml 2010-02-10
00:39:52 UTC (rev 16438)
@@ -0,0 +1,16 @@
+ <tag>
+ <tag-name>javax.faces.component.UIOutput</tag-name>
+ <validator>
+ <validator-id>foo.bar</validator-id>
+ <handler-class>javax.faces.component.UIOutput</handler-class>
+ </validator>
+
+ <attribute>
+ <name>testValue</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <name>testFlag</name>
+ <type>boolean</type>
+ </attribute>
+ </tag>
Deleted:
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTaglibGeneratorTest.xml
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/freemarker/ValidatorTaglibGeneratorTest.xml 2010-02-09
16:52:15 UTC (rev 16436)
+++
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTaglibGeneratorTest.xml 2010-02-10
00:39:52 UTC (rev 16438)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
-<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
- <tag>
- <tag-name>javax.faces.component.UIOutput</tag-name>
- <validator>
- <validator-id>foo.bar</validator-id>
- <handler-class>javax.faces.component.UIOutput</handler-class>
- </validator>
-
- <attribute>
- <name>testValue</name>
- <type>java.lang.Object</type>
- </attribute>
- <attribute>
- <name>testFlag</name>
- <type>boolean</type>
- </attribute>
- </tag>
-</facelet-taglib>
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-02-10
00:00:27 UTC (rev 16437)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-02-10
00:39:52 UTC (rev 16438)
@@ -45,8 +45,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Generator;
import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.StandardOutputFolders;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.Sources;
/**
* <p class="changed_added_4_0">
@@ -199,17 +199,17 @@
}
- generator.addSources(StandardSources.JAVA_SOURCES, findJavaFiles(), folders);
+ generator.addSources(Sources.JAVA_SOURCES, findJavaFiles(), folders);
// TODO - detect templates and configs directories.
- generator.addSources(StandardSources.RENDERER_TEMPLATES, findTemplateFiles(),
null);
- generator.addSources(StandardSources.FACES_CONFIGS, findFacesConfigFiles(),
null);
+ generator.addSources(Sources.RENDERER_TEMPLATES, findTemplateFiles(), null);
+ generator.addSources(Sources.FACES_CONFIGS, findFacesConfigFiles(), null);
// Setup output folders.
- setOutput(generator, outputJavaDirectory, StandardOutputFolders.JAVA_CLASSES);
- setOutput(generator, outputResourcesDirectory, StandardOutputFolders.RESOURCES);
- setOutput(generator, outputTestDirectory,
StandardOutputFolders.TEST_JAVA_CLASSES);
- setOutput(generator, outputTestResourcesDirectory,
StandardOutputFolders.TEST_RESOURCES);
+ setOutput(generator, outputJavaDirectory, Outputs.JAVA_CLASSES);
+ setOutput(generator, outputResourcesDirectory, Outputs.RESOURCES);
+ setOutput(generator, outputTestDirectory, Outputs.TEST_JAVA_CLASSES);
+ setOutput(generator, outputTestResourcesDirectory, Outputs.TEST_RESOURCES);
// configure CDK workers.
setupPlugins(generator);
@@ -264,7 +264,7 @@
* @param directory
* @param type
*/
- private static void setOutput(Generator generator, File directory,
StandardOutputFolders type) {
+ private static void setOutput(Generator generator, File directory, Outputs type) {
if (!directory.exists()) {
directory.mkdirs();
}