Author: Alex.Kolonitsky
Date: 2010-05-04 08:50:17 -0400 (Tue, 04 May 2010)
New Revision: 16881
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.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/model/ModelCollection.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.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/templatecompiler/TemplateModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstPropertySuffixTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/BinaryArithmeticOperationTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Pair.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/XmlModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
root/ui/trunk/components/core/src/test/java/org/richfaces/component/AbstractQueueComponentTest.java
Log:
fix checkstyle
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -23,21 +23,20 @@
package org.richfaces.cdk;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Set;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class CdkClassLoader extends URLClassLoader {
@@ -50,8 +49,8 @@
addFiles(files);
}
- public CdkClassLoader(Iterable<File> files,ClassLoader parent) throws
MalformedURLException {
- super(EMPTY_URLS,parent);
+ public CdkClassLoader(Iterable<File> files, ClassLoader parent) throws
MalformedURLException {
+ super(EMPTY_URLS, parent);
addFiles(files);
}
@@ -61,6 +60,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the files
*/
public Iterable<File> getFiles() {
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -35,7 +35,7 @@
/**
* <p class="changed_added_4_0"></p>
*/
- public CdkException() {}
+ public CdkException() { }
/**
* <p class="changed_added_4_0"></p>
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingException.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingException.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingException.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -44,7 +44,7 @@
/**
* <p class="changed_added_4_0"></p>
*/
- public CdkProcessingException() {}
+ public CdkProcessingException() { }
/**
* <p class="changed_added_4_0"></p>
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-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -69,7 +69,7 @@
private Map<Outputs, FileManager> outputFolders =
Maps.newEnumMap(Outputs.class);
- private Map<Sources,FileManager> sources = Maps.newEnumMap(Sources.class);
+ private Map<Sources, FileManager> sources = Maps.newEnumMap(Sources.class);
private LibraryBuilder libraryBuilder;
@@ -100,7 +100,7 @@
this.outputFolders.put(type, new OutputFileManager(outputFolder));
}
- public void addSources(Sources 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));
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -21,12 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
-
-
/**
* <p class="changed_added_4_0">
* That class builds JSF library model from different sources. It acts as
@@ -34,9 +30,8 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
-public interface LibraryBuilder {
+public interface LibraryBuilder {
/**
* <p class="changed_added_4_0">
@@ -45,13 +40,13 @@
*
* @throws CdkException
*/
- public void build() throws CdkException ;
+ public void build() throws CdkException;
/**
* Generate all types of files from library model.
- *
+ *
* @throws CdkException
*/
- public void generate() throws CdkException ;
+ public void generate() throws CdkException;
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -103,7 +103,7 @@
}
@Override
- public String inferUIComponentFamily( FacesId componentType) {
+ public String inferUIComponentFamily (FacesId componentType) {
if (null == componentType) {
throw new IllegalArgumentException();
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -33,7 +33,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class SourceFileManager implements FileManager {
@@ -50,6 +49,7 @@
*
* @see org.richfaces.cdk.FileManager#createFile(java.lang.String)
*/
+
@Override
public Writer createOutput(String path, long lastModified) throws IOException {
throw new UnsupportedOperationException("Cannot create file in source
folder");
@@ -60,6 +60,7 @@
*
* @see org.richfaces.cdk.FileManager#getFile(java.lang.String)
*/
+
@Override
public File getFile(String path) throws FileNotFoundException {
String platformPath;
@@ -80,9 +81,9 @@
}
}
}
- if(null != sources){
+ if (null != sources) {
for (File file : sources) {
- if(file.getAbsolutePath().endsWith(platformPath)){
+ if (file.getAbsolutePath().endsWith(platformPath)) {
return file;
}
}
@@ -95,6 +96,7 @@
*
* @see org.richfaces.cdk.FileManager#getFiles()
*/
+
@Override
public Iterable<File> getFiles() {
return sources;
@@ -102,6 +104,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the folders
*/
@Override
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -42,23 +42,24 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class AptModule extends AbstractModule {
/* (non-Javadoc)
* @see com.google.inject.AbstractModule#configure()
*/
+
@Override
protected void configure() {
- Multibinder<CdkAnnotationProcessor> setBinder =
Multibinder.newSetBinder(binder(),CdkAnnotationProcessor.class);
+ Multibinder<CdkAnnotationProcessor> setBinder =
Multibinder.newSetBinder(binder(), CdkAnnotationProcessor.class);
setBinder.addBinding().to(ComponentProcessor.class);
setBinder.addBinding().to(BehaviorProcessor.class);
setBinder.addBinding().to(RendererProcessor.class);
setBinder.addBinding().to(ConverterProcessor.class);
setBinder.addBinding().to(ValidatorProcessor.class);
-
+
bind(Processor.class).to(CdkProcessor.class);
bind(AttributesProcessor.class).to(AttributesProcessorImpl.class);
bind(DescriptionProcessor.class).to(DescriptionProcessorImpl.class);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -61,7 +61,7 @@
// Get all methods and fields annotated by annotation.
for (Element childElement : members) {
- boolean annotated = (null != childElement.getAnnotation(annotation));
+ boolean annotated = null != childElement.getAnnotation(annotation);
if (!annotated) {
continue;
}
@@ -249,7 +249,7 @@
@Override
public TypeElement asTypeElement(TypeMirror mirror) {
- if(TypeKind.DECLARED.equals(mirror.getKind())){
+ if (TypeKind.DECLARED.equals(mirror.getKind())) {
return (TypeElement) processingEnv.getTypeUtils().asElement(mirror);
} else {
return null;
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -88,7 +88,7 @@
if (!roundEnv.processingOver()) {
// Process annotations.
for (CdkAnnotationProcessor process : processors) {
- processAnnotation(process,roundEnv);
+ processAnnotation(process, roundEnv);
}
// parse non-java sources
for (ModelBuilder builder : builders) {
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -52,7 +52,7 @@
setTagInfo(behavior.tag(), behaviorModel);
AttributesProcessor attributesProcessor = getAttributeProcessor();
attributesProcessor.processXmlFragment(behaviorModel, behavior.attributes());
- attributesProcessor.processType(behaviorModel,element);
+ attributesProcessor.processType(behaviorModel, element);
setDescription(behaviorModel, behavior.description(), getDocComment(element));
library.getBehaviors().add(behaviorModel);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -63,7 +63,7 @@
AttributesProcessor attributesProcessor = getAttributeProcessor();
attributesProcessor.processXmlFragment(converterModel, converter.attributes());
- attributesProcessor.processType(converterModel,element);
+ attributesProcessor.processType(converterModel, element);
setClassNames(element, converterModel, converter.generate());
setTagInfo(converter.tag(), converterModel);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -29,8 +29,8 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class DescriptionProcessorImpl implements DescriptionProcessor {
@@ -52,9 +52,10 @@
@Override
public void processDescription(DescriptionGroup model, Description description) {
- processDescription(model, description,null);
+ processDescription(model, description, null);
}
+
protected void setIcon(DescriptionGroup component, Description icon) {
if (null != icon && (!Strings.isEmpty(icon.smallIcon()) ||
!Strings.isEmpty(icon.largeIcon()))) {
DescriptionGroup.Icon iconValue = new DescriptionGroup.Icon();
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -121,6 +121,6 @@
}
protected void setDescription(DescriptionGroup model, Description description, String
docComment) {
- descriptionProcessor.processDescription(model, description,docComment);
+ descriptionProcessor.processDescription(model, description, docComment);
}
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -176,7 +176,7 @@
return value.toString();
}
- return
null;//getNamingConventions().inferRendererTypeByRendererClass(asClassDesctiption(rendererElement));
+ return null;
//getNamingConventions().inferRendererTypeByRendererClass(asClassDesctiption(rendererElement));
}
private void setRendererType(TypeElement rendererElement, RendererModel
rendererModel, JsfRenderer annotation) {
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-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -138,7 +138,7 @@
RenderKitModel renderKit = renderKits.get(renderKitType);
- if(null == renderKit){
+ if (null == renderKit) {
renderKit = new RenderKitModel();
renderKits.put(renderKitType, renderKit);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -35,11 +35,10 @@
/**
* <p class="changed_added_4_0">
* Base class for all model collections. This collection use {@link
Mergeable#same(Object)} method instead of equals
- * to lookup objects in the {@link #contains(Object)} and {@link #remove(Object)}
methods. In addition, it merges same objects instead of replace in the {@link
#add(ModelElement)} method.
+ * to lookup objects in the {@link #contains(Object)} and {@link #remove(Object)}
methods. In addition, it merges same objects instead of replace in the {@link
#add(ModelElement)} method.
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class ModelCollection<E extends ModelElement<? super E>> implements
Collection<E>, Visitable {
@@ -49,7 +48,6 @@
return new ModelCollection<T>();
}
-
public E find(final Predicate<? super E> predicate) {
try {
return Iterables.find(elements, predicate);
@@ -60,7 +58,7 @@
@Override
public boolean add(E e) {
- if(null == e){
+ if (null == e) {
throw new NullPointerException();
}
for (E element : elements) {
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -1,10 +1,9 @@
package org.richfaces.cdk.model;
-import java.util.Collection;
-
import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
+import java.util.Collection;
+
/**
* <p class="changed_added_4_0">Base class for the most JSF components
taht have description
* attributes and support extensions in faces-config.</p>
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -44,7 +44,7 @@
@Override
public void merge(ValidatorModel other) {
- ComponentLibrary.merge(getAttributes(),other.getAttributes());
+ ComponentLibrary.merge(getAttributes(), other.getAttributes());
ComponentLibrary.merge(this, other);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -41,7 +41,7 @@
public class JavaClassConfiguration extends Configuration implements FreeMarkerRenderer
{
private static final String TEMPLATES = "/META-INF/templates/java";
- public JavaClassConfiguration(){
+ public JavaClassConfiguration() {
// TODO set proper template loader.
setClassForTemplateLoading(this.getClass(), TEMPLATES);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -27,13 +27,6 @@
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
-import org.richfaces.cdk.templatecompiler.builder.model.Argument;
-import org.richfaces.cdk.templatecompiler.builder.model.JavaClass;
-import org.richfaces.cdk.templatecompiler.builder.model.JavaField;
-import org.richfaces.cdk.templatecompiler.builder.model.JavaMethod;
-import org.richfaces.cdk.templatecompiler.builder.model.JavaModifier;
-import org.richfaces.cdk.templatecompiler.builder.model.MethodBody;
-import org.richfaces.cdk.templatecompiler.builder.model.MethodBodyStatementsContainer;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.attributes.Attribute;
@@ -42,13 +35,19 @@
import org.richfaces.cdk.attributes.SchemaSet;
import org.richfaces.cdk.model.EventName;
import org.richfaces.cdk.model.PropertyBase;
+import org.richfaces.cdk.templatecompiler.builder.model.Argument;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaClass;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaField;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaMethod;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaModifier;
+import org.richfaces.cdk.templatecompiler.builder.model.MethodBody;
+import org.richfaces.cdk.templatecompiler.builder.model.MethodBodyStatementsContainer;
import org.richfaces.cdk.templatecompiler.el.ELParserUtils;
import org.richfaces.cdk.templatecompiler.el.ELVisitor;
import org.richfaces.cdk.templatecompiler.el.HelperMethod;
import org.richfaces.cdk.templatecompiler.el.ParsingException;
import org.richfaces.cdk.templatecompiler.el.Type;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
-import static org.richfaces.cdk.templatecompiler.QNameComparator.QNAME_COMPARATOR;
import org.richfaces.cdk.templatecompiler.model.AnyElement;
import org.richfaces.cdk.templatecompiler.model.CdkBodyElement;
import org.richfaces.cdk.templatecompiler.model.CdkCallElement;
@@ -62,8 +61,6 @@
import org.richfaces.cdk.templatecompiler.model.CompositeInterface;
import org.richfaces.cdk.templatecompiler.model.Template;
import org.richfaces.cdk.templatecompiler.model.TemplateVisitor;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedStringsArray;
import org.richfaces.cdk.util.Strings;
import org.richfaces.cdk.xmlconfig.JAXB;
@@ -84,16 +81,20 @@
import java.util.Set;
import java.util.TreeMap;
+import static org.richfaces.cdk.templatecompiler.QNameComparator.QNAME_COMPARATOR;
+import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
+import static org.richfaces.cdk.util.JavaUtils.getEscapedStringsArray;
+
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
*/
public class RendererClassVisitor implements TemplateVisitor {
/**
- *
+ *
*/
// TODO externalize
static final String RENDER_KIT_UTILS_CLASS_NAME =
"org.richfaces.renderkit.RenderKitUtils";
@@ -123,14 +124,14 @@
static final String CLIENT_ID_VARIABLE = "clientId";
/**
- *
+ *
*/
private static final String PASS_THROUGH_ATTRIBUTES_FIELD_NAME =
"PASS_THROUGH_ATTRIBUTES";
private static final Set<String> DEFAULT_NAMESPACES =
ImmutableSet.of(Template.XHTML_EL_NAMESPACE,
Template.XHTML_NAMESPACE);
- private static final EnumMap<HelperMethod, HelperMethodBodyStatement>
HELPER_METHOD_BODIES =
+ private static final EnumMap<HelperMethod, HelperMethodBodyStatement>
HELPER_METHOD_BODIES =
new EnumMap<HelperMethod, HelperMethodBodyStatement>(HelperMethod.class);
static {
@@ -139,7 +140,7 @@
HELPER_METHOD_BODIES.put(HelperMethod.TO_BOOLEAN_CONVERSION, new
ConversionToBooleanMethodBodyStatement());
HELPER_METHOD_BODIES.put(HelperMethod.TO_STRING_CONVERSION, new
ConversionToStringMethodBodyStatement());
}
-
+
private final Logger log;
private MethodBodyStatementsContainer currentStatement;
@@ -160,7 +161,7 @@
private Collection<PropertyBase> attributes;
public RendererClassVisitor(CompositeInterface compositeInterface,
Collection<PropertyBase> attributes,
- ClassLoader classLoader, JAXB jaxbBinding, Logger log) {
+ ClassLoader classLoader, JAXB jaxbBinding, Logger log) {
this.compositeInterface = compositeInterface;
this.attributes = attributes;
this.classLoader = classLoader;
@@ -190,18 +191,18 @@
private void addHelperMethod(HelperMethod helperMethod) {
if (addedHelperMethods.add(helperMethod)) {
HelperMethodBodyStatement methodBodyStatement =
HELPER_METHOD_BODIES.get(helperMethod);
-
+
String[] argumentNames = methodBodyStatement.getArgumentNames();
Class<?>[] argumentTypes = helperMethod.getArgumentTypes();
assert argumentNames.length == argumentTypes.length;
-
+
Argument[] arguments = new Argument[argumentTypes.length];
for (int i = 0; i < arguments.length; i++) {
arguments[i] = new Argument(argumentNames[i], argumentTypes[i]);
}
- JavaMethod helperJavaMethod = new JavaMethod(helperMethod.getName(),
+ JavaMethod helperJavaMethod = new JavaMethod(helperMethod.getName(),
helperMethod.getReturnType(), arguments);
helperJavaMethod.addModifier(JavaModifier.PRIVATE);
@@ -292,7 +293,7 @@
}
// OPTIMIZATION - use ModelCollection with lookup method
- for (PropertyBase property : attributes) {
+ for (PropertyBase property : attributes) {
if (attributeName.equals(property.getName())) {
Set<EventName> eventNames = property.getEventNames();
if (eventNames != null && !eventNames.isEmpty()) {
@@ -333,8 +334,8 @@
generatedClass.addImport(Collections.class);
// TODO - get rid of FQNs for classes via imports
- passThroughField.setGenericArguments(new JavaClass[] { new
JavaClass(String.class),
- new JavaClass("org.richfaces.renderkit.ComponentAttribute") });
+ passThroughField.setGenericArguments(new JavaClass[]{new
JavaClass(String.class),
+ new JavaClass("org.richfaces.renderkit.ComponentAttribute")});
StringBuilder fieldValue = new
StringBuilder("Collections.unmodifiableMap(ComponentAttribute.createMap(");
boolean isFirstArgument = true;
@@ -424,7 +425,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the rendererClass
*/
public JavaClass getGeneratedClass() {
@@ -437,6 +438,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
*/
+
@Override
public void startElement(CdkBodyElement cdkBodyElement) throws CdkException {
flushToEncodeMethod("encodeBegin");
@@ -448,6 +450,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
*/
+
@Override
public void endElement(CdkBodyElement cdkBodyElement) throws CdkException {
flushToEncodeMethod("encodeChildren");
@@ -459,6 +462,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
+
@Override
public void startElement(AnyElement anyElement) throws CdkException {
QName elementName = anyElement.getName();
@@ -536,6 +540,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
+
@Override
public void endElement(AnyElement anyElement) throws CdkException {
QName elementName = anyElement.getName();
@@ -547,6 +552,7 @@
*
* @see
org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(java.lang.String)
*/
+
@Override
public void visitElement(String text) throws CdkException {
if (text != null) {
@@ -563,6 +569,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #visitElement(org.richfaces.cdk.templatecompiler.model.CdkCallElement)
*/
+
@Override
public void visitElement(CdkCallElement cdkCallElement) throws CdkException {
String expression = cdkCallElement.getExpression();
@@ -579,6 +586,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
*/
+
@Override
public void startElement(CdkIfElement cdkIfElement) {
String compiledTestExpression = compileEl(cdkIfElement.getTest(), Boolean.TYPE);
@@ -593,6 +601,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
*/
+
@Override
public void endElement(CdkIfElement cdkIfElement) {
popStatement();
@@ -605,6 +614,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
*/
+
@Override
public void startElement(CdkChooseElement cdkChooseElement) {
pushStatement(new IfElseStatement());
@@ -616,6 +626,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
*/
+
@Override
public void endElement(CdkChooseElement cdkChooseElement) {
popStatement();
@@ -627,6 +638,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
*/
+
@Override
public void startElement(CdkWhenElement cdkWhenElement) {
String compiledTestExpression = compileEl(cdkWhenElement.getTest(),
Boolean.TYPE);
@@ -640,6 +652,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
*/
+
@Override
public void endElement(CdkWhenElement cdkWhenElement) {
popStatement();
@@ -651,6 +664,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
*/
+
@Override
public void startElement(CdkOtherwiseElement cdkOtherwiseElement) {
pushStatement(new IfStatement(""));
@@ -662,6 +676,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
*/
+
@Override
public void endElement(CdkOtherwiseElement cdkOtherwiseElement) {
popStatement();
@@ -673,6 +688,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #visitElement(org.richfaces.cdk.templatecompiler.model.CdkObjectElement)
*/
+
@Override
public void visitElement(CdkObjectElement cdkObjectElement) {
String name = cdkObjectElement.getName();
@@ -721,6 +737,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
*/
+
@Override
public void startElement(CdkForEachElement cdkForEachElement) {
String items = cdkForEachElement.getItems();
@@ -742,6 +759,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
*/
+
@Override
public void endElement(CdkForEachElement cdkForEachElement) {
popStatement();
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-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -155,9 +155,9 @@
*/
@Override
public void build() throws CdkException {
- Iterable<File> sources = this.sources.getFiles();
- if (null != sources) {
- for (File file : sources) {
+ Iterable<File> sourceFiles = this.sources.getFiles();
+ if (null != sourceFiles) {
+ for (File file : sourceFiles) {
build(file, null);
}
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateModule.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateModule.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateModule.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -44,7 +44,7 @@
protected void configure() {
Multibinder<ModelBuilder> modelBinder = Multibinder.newSetBinder(binder(),
ModelBuilder.class);
modelBinder.addBinding().to(RendererTemplateParser.class);
-
Multibinder.newSetBinder(binder(),CdkWriter.class).addBinding().to(RendererClassGenerator.class);
+ Multibinder.newSetBinder(binder(),
CdkWriter.class).addBinding().to(RendererClassGenerator.class);
bind(new
TypeLiteral<TemplateVisitorFactory<RendererClassVisitor>>(){}).to(VisitorFactoryImpl.class);
bind(FreeMarkerRenderer.class).to(JavaClassConfiguration.class);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserUtils.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserUtils.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserUtils.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -463,7 +463,7 @@
public static String coerceToType(String valueString, ELVisitor visitor, Type
expectedType) {
if (!expectedType.isAssignableFrom(visitor.getExpressionType())) {
- for (HelperMethod conversionMethod: HelperMethod.getConversionMethods()) {
+ for (HelperMethod conversionMethod : HelperMethod.getConversionMethods()) {
Type returnType =
TypesFactory.getType(conversionMethod.getReturnType());
if (expectedType.isAssignableFrom(returnType)) {
visitor.getUsedHelperMethods().add(conversionMethod);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstPropertySuffixTreeNode.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstPropertySuffixTreeNode.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstPropertySuffixTreeNode.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -43,13 +43,13 @@
super(node);
}
- private final String capitalize(String propertyName) {
+ private String capitalize(String propertyName) {
char[] chars = propertyName.toCharArray();
chars[0] = Character.toUpperCase(chars[0]);
return new String(chars);
}
- private final Method getReadMethod(Class<?> clazz, String propertyName) {
+ private Method getReadMethod(Class<?> clazz, String propertyName) {
if (clazz == null) {
return null;
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/BinaryArithmeticOperationTreeNode.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/BinaryArithmeticOperationTreeNode.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/BinaryArithmeticOperationTreeNode.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -44,15 +44,16 @@
/* (non-Javadoc)
* @see
org.richfaces.cdk.templatecompiler.el.node.AbstractBinaryOperationTreeNode#getOperationType(java.lang.reflect.Type,
java.lang.reflect.Type)
*/
+
@Override
protected Type getOperationType(Type firstArgumentType,
Type secondArgumentType) {
Type doubleType = TypesFactory.getType(Double.class);
-
- if (doubleType.isAssignableFrom(firstArgumentType) ||
- doubleType.isAssignableFrom(secondArgumentType)) {
+ if (doubleType.isAssignableFrom(firstArgumentType)
+ || doubleType.isAssignableFrom(secondArgumentType)) {
+
return TypesFactory.getType(Double.TYPE);
}
@@ -62,10 +63,11 @@
/* (non-Javadoc)
* @see
org.richfaces.cdk.templatecompiler.el.node.AbstractBinaryOperationTreeNode#getCoercedChildOutput(int,
java.util.Map, org.richfaces.cdk.templatecompiler.el.ELVisitor)
*/
+
@Override
protected String getCoercedChildOutput(int childIndex, ELVisitor visitor)
throws ParsingException {
-
+
//TODO implement coercion to number
return getChildOutput(childIndex, visitor);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -35,12 +35,11 @@
/**
* @author Nick Belaevski
- *
*/
public final class JavaUtils {
public static final ImmutableMap<Class<?>, Class<?>> BOXING_CLASSES
=
- ImmutableMap.<Class<?>, Class<?>> builder().put(Boolean.TYPE,
Boolean.class).put(Character.TYPE,
+ ImmutableMap.<Class<?>, Class<?>>builder().put(Boolean.TYPE,
Boolean.class).put(Character.TYPE,
Character.class).put(Byte.TYPE, Byte.class).put(Short.TYPE,
Short.class).put(Integer.TYPE, Integer.class)
.put(Long.TYPE, Long.class).put(Float.TYPE, Float.class).put(Double.TYPE,
Double.class).build();
@@ -52,7 +51,7 @@
* <p class="changed_added_4_0">
* Transform character to Java code expression
* </p>
- *
+ *
* @param c
* @return
*/
@@ -84,7 +83,7 @@
* <p class="changed_added_4_0">
* Escapes string into Java language expression
* </p>
- *
+ *
* @param s
* @return
*/
@@ -127,7 +126,7 @@
* <p class="changed_added_4_0">
* Escapes sequence of strings into comma-separated sequence of Java language
expressions
* </p>
- *
+ *
* @param strings
* @return
*/
@@ -202,9 +201,9 @@
for (PropertyDescriptor sourceProperty : sourceProperties) {
if (!JAXBBinding.IGNORE_PROPERTIES.contains(name) &&
name.equals(sourceProperty.getName())) {
try {
- writeProperty(source, destination, targetProperty,
sourceProperty);
+ writeProperty(source, destination, targetProperty,
sourceProperty);
} catch (Exception e) {
- throw new CdkException("Error on copying property
"+name+" from object "+source.getClass()+" to
"+destination.getClass(), e);
+ throw new CdkException("Error on copying property "
+ name + " from object " + source.getClass() + " to " +
destination.getClass(), e);
}
}
}
@@ -215,7 +214,7 @@
}
public static void writeProperty(Object source, Object destination,
PropertyDescriptor targetProperty,
- PropertyDescriptor sourceProperty) throws IllegalAccessException,
InvocationTargetException {
+ PropertyDescriptor sourceProperty) throws
IllegalAccessException, InvocationTargetException {
Method readMethod = sourceProperty.getReadMethod();
if (readMethod == null) {
return;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Pair.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Pair.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Pair.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -25,10 +25,10 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
-public class Pair<A,B> {
+public class Pair<A, B> {
private final A first;
@@ -36,6 +36,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param first
* @param second
*/
@@ -44,12 +45,13 @@
this.second = second;
}
- public static <X,Y> Pair<X,Y> of( X first, Y second){
- return new Pair<X, Y>(first,second);
+ public static <X, Y> Pair<X, Y> of(X first, Y second) {
+ return new Pair<X, Y>(first, second);
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the first
*/
public A getFirst() {
@@ -58,6 +60,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the second
*/
public B getSecond() {
@@ -67,6 +70,7 @@
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+
@Override
public int hashCode() {
final int prime = 31;
@@ -79,6 +83,7 @@
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+
@Override
public boolean equals(Object obj) {
if (this == obj) {
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/XmlModule.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/XmlModule.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/XmlModule.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -47,7 +47,7 @@
bind(NamespacePrefixMapper.class).to(FacesConfigNamespacePreffixMapper.class);
Multibinder.newSetBinder(binder(), ModelBuilder.class)
.addBinding().to(FacesConfigParser.class);
- Multibinder.newSetBinder(binder(),CdkWriter.class)
+ Multibinder.newSetBinder(binder(), CdkWriter.class)
.addBinding().to(FacesConfigGenerator.class);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -22,24 +22,23 @@
package org.richfaces.cdk.xmlconfig.model;
-import java.util.Collection;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.Collection;
+
/**
* @author akolonitsky
* @since Jan 21, 2010
*/
@XmlType(name = "faces-config-behaviorType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"id", "targetClass", "facesAttributes",
"properties", "extension"})
+ propOrder = {"id", "targetClass", "facesAttributes",
"properties", "extension"})
@XmlJavaTypeAdapter(BehaviorAdapter.class)
public class BehaviorBean extends ElementBeanBase<BehaviorBean.BehaviorExtension>
{
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -23,13 +23,7 @@
package org.richfaces.cdk.xmlconfig.model;
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -39,7 +33,11 @@
import org.richfaces.cdk.model.PropertyModel;
import org.richfaces.cdk.model.TagModel;
-import com.google.common.collect.Lists;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.Collection;
+import java.util.List;
/**
* <p class="changed_added_4_0"></p>
@@ -47,10 +45,10 @@
* @author asmirnov(a)exadel.com
*/
@XmlType(name = "faces-config-componentType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"type", "targetClass", "facets",
"facesAttributes", "properties", "extension"})
+ propOrder = {"type", "targetClass", "facets",
"facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(ComponentAdapter.class)
public class ComponentBean extends
ElementBeanBase<ComponentBean.ComponentExtension> {
-
+
private List<FacetModel> facets = Lists.newArrayList();
private ClassName targetClass;
private FacesId type;
@@ -60,7 +58,7 @@
*
* @return the type
*/
- @XmlElement(name = "component-type", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,required=true)
+ @XmlElement(name = "component-type", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE, required = true)
public FacesId getType() {
return type;
}
@@ -145,10 +143,11 @@
}
public static class ComponentExtension extends ExtensionBeanBase {
- private String rendererType ;
+ private String rendererType;
private List<EventModel> events = Lists.newArrayList();
private List<TagModel> tags = Lists.newArrayList();
private String family;
+
/**
* <p class="changed_added_4_0"></p>
*
@@ -209,6 +208,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the tags
*/
@XmlElement(name = "tag", namespace =
ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -218,6 +218,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param tags the tags to set
*/
public void setTags(List<TagModel> tags) {
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -21,25 +21,23 @@
package org.richfaces.cdk.xmlconfig.model;
+import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
-import org.richfaces.cdk.model.AttributeModel;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
import java.util.Collection;
-import java.util.List;
/**
* @author akolonitsky
* @since Jan 6, 2010
*/
@XmlType(name = "faces-config-converterType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"id", "converterForClass", "targetClass",
"facesAttributes", "properties", "extension"})
+ propOrder = {"id", "converterForClass", "targetClass",
"facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(ConverterAdapter.class)
public class ConverterBean extends
ElementBeanBase<ConverterBean.ConverterExtension> {
@@ -58,7 +56,6 @@
this.id = id;
}
-
@Override
@XmlElement(name = "property", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE, type = PropertyBean.class)
@XmlJavaTypeAdapter(PropertyAdapter.class)
@@ -90,12 +87,12 @@
public void setTargetClass(ClassName converterClass) {
this.targetClass = converterClass;
}
-
+
@Override
public void setExtension(ConverterExtension extension) {
super.setExtension(extension);
}
-
+
@XmlElement(name = "converter-extension", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE, nillable = true)
@Override
public ConverterExtension getExtension() {
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -23,10 +23,7 @@
package org.richfaces.cdk.xmlconfig.model;
import org.richfaces.cdk.model.BeanModelBase;
-import org.richfaces.cdk.model.AttributeModel;
-import java.util.ArrayList;
-
/**
* @author akolonitsky
* @since Mar 19, 2010
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -41,14 +41,14 @@
@SuppressWarnings("unchecked")
public abstract class ElementBeanBase<E extends ConfigExtension> extends
ExtensibleBean<E> {
- private static final Predicate<PropertyBase> propertyPredicate = new
Predicate<PropertyBase>() {
+ private static final Predicate<PropertyBase> PROPERTY_PREDICATE = new
Predicate<PropertyBase>() {
@Override
public boolean apply(PropertyBase input) {
return input instanceof PropertyModel;
}
};
- private static final Predicate<PropertyBase> attributePredicate = new
Predicate<PropertyBase>() {
+ private static final Predicate<PropertyBase> ATTRIBUTE_PREDICATE = new
Predicate<PropertyBase>() {
@Override
public boolean apply(PropertyBase input) {
return input instanceof AttributeModel;
@@ -57,9 +57,9 @@
private Collection<? extends PropertyBase> attributes = Lists.newArrayList();
- private Collection<PropertyModel> properties =
(Collection<PropertyModel>) Collections2.filter(attributes, propertyPredicate);
+ private Collection<PropertyModel> properties =
(Collection<PropertyModel>) Collections2.filter(attributes, PROPERTY_PREDICATE);
- private Collection<AttributeModel> facesAttributes =
(Collection<AttributeModel>) Collections2.filter(attributes, attributePredicate);
+ private Collection<AttributeModel> facesAttributes =
(Collection<AttributeModel>) Collections2.filter(attributes, ATTRIBUTE_PREDICATE);
public Collection<PropertyModel> getProperties() {
return properties;
@@ -77,7 +77,7 @@
public void setAttributes(Collection<PropertyBase> attributes) {
this.attributes = attributes;
- properties = (Collection<PropertyModel>)
Collections2.filter(this.attributes, propertyPredicate);
- facesAttributes = (Collection<AttributeModel>)
Collections2.filter(this.attributes, attributePredicate);
+ properties = (Collection<PropertyModel>)
Collections2.filter(this.attributes, PROPERTY_PREDICATE);
+ facesAttributes = (Collection<AttributeModel>)
Collections2.filter(this.attributes, ATTRIBUTE_PREDICATE);
}
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -23,19 +23,17 @@
package org.richfaces.cdk.xmlconfig.model;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
import org.richfaces.cdk.model.TagModel;
-import com.google.common.collect.Lists;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.List;
/**
* <p class="changed_added_4_0">
@@ -44,7 +42,7 @@
* @author asmirnov(a)exadel.com
*/
@XmlType(name = "faces-config-rendererType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,
-
propOrder={"family","type","rendererClass",/*"facet",*/"attributes","extension"})
+ propOrder = {"family", "type",
"rendererClass",/*"facet",*/"attributes",
"extension"})
public class RendererBean extends
ExtensibleBean<RendererBean.RendererExtension> {
@@ -168,9 +166,9 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ * <p/>
* TODO
- *
+ *
* @return the tag
*/
// @XmlElement(name = "tag", namespace =
ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -21,18 +21,16 @@
package org.richfaces.cdk.xmlconfig.model;
+import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
-import org.richfaces.cdk.model.AttributeModel;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
import java.util.Collection;
-import java.util.List;
/**
* @author akolonitsky
Modified:
root/ui/trunk/components/core/src/test/java/org/richfaces/component/AbstractQueueComponentTest.java
===================================================================
---
root/ui/trunk/components/core/src/test/java/org/richfaces/component/AbstractQueueComponentTest.java 2010-05-04
05:15:25 UTC (rev 16880)
+++
root/ui/trunk/components/core/src/test/java/org/richfaces/component/AbstractQueueComponentTest.java 2010-05-04
12:50:17 UTC (rev 16881)
@@ -492,3 +492,5 @@
}
}
}
+
+