Author: alexsmirnov
Date: 2009-12-29 16:36:27 -0500 (Tue, 29 Dec 2009)
New Revision: 16229
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl
Log:
Fix checkstyle errors
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 2009-12-29
21:36:21 UTC (rev 16228)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2009-12-29
21:36:27 UTC (rev 16229)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
import java.lang.annotation.Annotation;
@@ -51,21 +49,20 @@
/**
* <p class="changed_added_4_0">
- * Base class for all CDK Annotation processors. That class provides access to
- * current CDK context and utility methods for Java source models.
+ * Base class for all CDK Annotation processors. That class provides access to current
CDK context and utility methods
+ * for Java source models.
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class CdkProcessor extends AbstractProcessor implements CdkWorker {
private static final Set<String> ANY_ANNOTATION =
Collections.singleton("*");
private static final ImmutableList<Pair<? extends Class<? extends
Annotation>, ? extends Class<? extends CdkAnnotationProcessor>>> PROCESSORS
= ImmutableList
- .of(Pair.of(Component.class, ComponentProcessor.class),
- Pair.of(FacesComponent.class, FacesComponentProcessor.class),
- Pair.of(Behavior.class, BehaviorProcessor.class));
+ .of(Pair.of(Component.class, ComponentProcessor.class),
Pair.of(FacesComponent.class,
+ FacesComponentProcessor.class), Pair.of(Behavior.class,
BehaviorProcessor.class));
/**
* <p class="changed_added_4_0">
@@ -77,22 +74,21 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @param context
* current CDK context
- * @throws CdkException
+ * @throws CdkException
*/
public void init(CdkContext context) throws CdkException {
this.context = context;
}
-
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
roundEnv) {
- SourceUtils sourceUtils = new SourceUtils(this.processingEnv,roundEnv);
+ SourceUtils sourceUtils = new SourceUtils(this.processingEnv, roundEnv);
sourceUtils.init(getContext());
getContext().setWorker(SourceUtils.class, sourceUtils);
- if(!roundEnv.processingOver()){
+ if (!roundEnv.processingOver()) {
// Process annotations.
for (Pair<? extends Class<? extends Annotation>, ? extends
Class<? extends CdkAnnotationProcessor>> process : PROCESSORS) {
processAnnotation(process.getFirst(), process.getSecond());
@@ -101,7 +97,7 @@
getContext().getBuilderFor(StandardSources.FACES_CONFIGS).build();
getContext().getBuilderFor(StandardSources.RENDERER_TEMPLATES).build();
getContext().getWorker(ModelValidator.class).verify(getContext().getLibrary());
- } else if(!getContext().getErrors().iterator().hasNext()){
+ } else if (!getContext().getErrors().iterator().hasNext()) {
// processing over, generate files.
for (OutputType type : StandardOutputs.values()) {
getContext().getGeneratorFor(type).render();
@@ -112,8 +108,10 @@
return false;
}
- protected void processAnnotation(Class<? extends Annotation> annotation,
Class<? extends CdkAnnotationProcessor> processor){
- Set<? extends TypeElement> annotatedWith =
getContext().getWorker(SourceUtils.class).getClassesAnnotatedWith(annotation);
+ protected void processAnnotation(Class<? extends Annotation> annotation,
+ Class<? extends CdkAnnotationProcessor> processor) {
+ Set<? extends TypeElement> annotatedWith =
getContext().getWorker(SourceUtils.class).getClassesAnnotatedWith(
+ annotation);
CdkAnnotationProcessor cdkAnnotationProcessor =
getContext().getWorker(processor);
for (TypeElement typeElement : annotatedWith) {
try {
@@ -126,14 +124,14 @@
protected void sendError(TypeElement componentElement, CdkProcessingException e) {
// rise error and continue.
- processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR,
e.getMessage(),
- componentElement);
+ processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR,
e.getMessage(), componentElement);
getContext().sendError(e);
}
+
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the context
*/
protected CdkContext getContext() {
Modified:
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl 2009-12-29
21:36:21 UTC (rev 16228)
+++
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl 2009-12-29
21:36:27 UTC (rev 16229)
@@ -1,6 +1,6 @@
<#macro concat seq delimiter=",">
<#list seq as item>
- <#nested item/><#if item_has_next>${delimiter}</#if>
+ <#nested item/><#if item_has_next>${delimiter}</#if>
</#list>
</#macro>
/*
@@ -45,24 +45,24 @@
* ${description?if_exists}
**/
@Generated({"RichFaces CDK", "4.0.0-SNAPSHOT"})
-public class ${componentClass.simpleName} extends ${baseClass} <#if (eventNames?size
> 0)>implements ClientBehaviorHolder</#if> {
+public class ${componentClass.simpleName} extends ${baseClass} <#if (eventNames?size
> 0)>implements ClientBehaviorHolder</#if> {
- public static final String COMPONENT_TYPE="${type}";
-
- <#if family?exists>
- public static final String COMPONENT_FAMILY="${family}";
-
- @Override
- public String getFamily() {
+ public static final String COMPONENT_TYPE="${type}";
+
+ <#if family?exists>
+ public static final String COMPONENT_FAMILY="${family}";
+
+ @Override
+ public String getFamily() {
return (COMPONENT_FAMILY);
}
- </#if>
-
- <#if (eventNames?size > 0)>
- private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(Arrays.asList(
- <@concat seq=eventNames ; event>"${event.name}"</@concat>
- ));
+ </#if>
+
+ <#if (eventNames?size > 0)>
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(Arrays.asList(
+ <@concat seq=eventNames ; event>"${event.name}"</@concat>
+ ));
public Collection<String> getEventNames() {
return EVENT_NAMES; }
@@ -70,26 +70,26 @@
public String getDefaultEventName() {
return <#if
defaultEvent?exists>"${defaultEvent.name}"<#else>null</#if>;
}
- </#if>
- protected enum Properties {
- <@concat seq=generatedAttributes ; attribute>${attribute.name}</@concat>
- ;
- }
+ </#if>
+ protected enum Properties {
+ <@concat seq=generatedAttributes ;
attribute>${attribute.name}</@concat>
+ ;
+ }
- <#list generatedAttributes as attribute>
- /**
- * ${attribute.description?if_exists}
- **/
- public ${attribute.type} ${attribute.getterName}(){
- return (${attribute.type})getStateHelper().eval(Properties.${attribute.name});
- }
+ <#list generatedAttributes as attribute>
+ /**
+ * ${attribute.description?if_exists}
+ **/
+ public ${attribute.type} ${attribute.getterName}(){
+ return (${attribute.type})getStateHelper().eval(Properties.${attribute.name});
+ }
- /**
- * Setter for ${attribute.name}
- **/
- public void ${attribute.setterName}(${attribute.type} ${attribute.name}){
- getStateHelper().put(Properties.${attribute.name},${attribute.name});
- }
- </#list>
+ /**
+ * Setter for ${attribute.name}
+ **/
+ public void ${attribute.setterName}(${attribute.type} ${attribute.name}){
+ getStateHelper().put(Properties.${attribute.name},${attribute.name});
+ }
+ </#list>
}
\ No newline at end of file