Author: Alex.Kolonitsky
Date: 2010-03-18 11:05:50 -0400 (Thu, 18 Mar 2010)
New Revision: 16605
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.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/ComponentModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
Log:
RF-8232 Tags support
remove visitor
fix checkstyle errors
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java 2010-03-18
15:04:03 UTC (rev 16604)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java 2010-03-18
15:05:50 UTC (rev 16605)
@@ -25,8 +25,6 @@
package org.richfaces.cdk.model;
-import org.richfaces.cdk.CdkException;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -43,19 +41,13 @@
setId(behaviorId);
}
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
- return visitor.visit(this, param);
- }
-
public void accept(Visitor visitor) {
visitor.visitBehavior(this);
}
@Override
public void merge(BehaviorModel 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/model/BehaviorRenderer.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2010-03-18
15:04:03 UTC (rev 16604)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2010-03-18
15:05:50 UTC (rev 16605)
@@ -25,8 +25,6 @@
package org.richfaces.cdk.model;
-import org.richfaces.cdk.CdkException;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -83,10 +81,6 @@
}
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
- return visitor.visit(this, param);
- }
-
public void accept(Visitor visitor) {
visitor.visitBehaviorRenderer(this);
}
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-03-18
15:04:03 UTC (rev 16604)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-03-18
15:05:50 UTC (rev 16605)
@@ -26,7 +26,6 @@
package org.richfaces.cdk.model;
import com.google.inject.Singleton;
-import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.model.RenderKitModel.Id;
import java.beans.IntrospectionException;
@@ -76,8 +75,6 @@
private final ModelCollection<ListenerModel> listeners =
ModelCollection.<ListenerModel>create();
- private final ModelCollection<RendererModel> renderers =
ModelCollection.<RendererModel>create();
-
private long lastModified = Long.MIN_VALUE;
/**
@@ -108,34 +105,16 @@
this.tagLibrary = new TagLibrary();
}
- public ModelCollection<RendererModel> getRenderers() {
- return renderers;
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
- R result = accept(components, visitor, param, null);
-
- result = accept(renderKits.values(), visitor, param, result);
- result = accept(converters, visitor, param, result);
- result = accept(validators, visitor, param, result);
- result = accept(listeners, visitor, param, result);
- result = accept(events, visitor, param, result);
- result = accept(behaviors, visitor, param, result);
-
- return result;
- }
-
public void accept(Visitor visitor) {
visitor.visitComponentLibrary(this);
- visitCollection(visitor, components);
visitMap(visitor, renderKits);
- visitCollection(visitor, converters);
- visitCollection(visitor, validators);
- visitCollection(visitor, listeners);
- visitCollection(visitor, events);
- visitCollection(visitor, behaviors);
+ components.accept(visitor);
+ converters.accept(visitor);
+ validators.accept(visitor);
+ listeners.accept(visitor);
+ events.accept(visitor);
+ behaviors.accept(visitor);
}
private void visitMap(Visitor visitor, ModelMap<Id, RenderKitModel> modelMap)
{
@@ -144,13 +123,6 @@
}
}
- @SuppressWarnings("unchecked")
- private void visitCollection(Visitor visitor, ModelCollection<?> models) {
- for (ModelElement component : models) {
- component.accept(visitor);
- }
- }
-
/**
* <p class="changed_added_4_0">
* </p>
@@ -356,21 +328,4 @@
// TODO Auto-generated catch block
}
}
-
- static <R, P, T extends ModelElement<T>> R accept(Iterable<T>
components, LibraryVisitor<R, P> visitor, P param,
- R result) throws CdkException {
- if (null == result) {
- for (T t : components) {
- R accept = t.accept(visitor, param);
-
- if (null != accept) {
- result = accept;
-
- break;
- }
- }
- }
-
- return result;
- }
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-03-18
15:04:03 UTC (rev 16604)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-03-18
15:05:50 UTC (rev 16605)
@@ -1,7 +1,5 @@
package org.richfaces.cdk.model;
-import org.richfaces.cdk.CdkException;
-
import java.util.Collection;
/**
@@ -46,14 +44,10 @@
}
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
- return visitor.visit(this, param);
- }
-
public void accept(Visitor visitor) {
visitor.visitComponent(this);
+ // TODO ??? see at render kit
for (RendererModel renderer : renderers) {
renderer.accept(visitor);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java 2010-03-18
15:04:03 UTC (rev 16604)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java 2010-03-18
15:05:50 UTC (rev 16605)
@@ -24,12 +24,11 @@
package org.richfaces.cdk.model;
-import java.util.List;
+import org.w3c.dom.Element;
import javax.xml.bind.annotation.XmlAnyElement;
+import java.util.List;
-import org.w3c.dom.Element;
-
/**
* <p class="changed_added_4_0">That class represents all faces-config
"extension" fields.</p>
*
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java 2010-03-18
15:04:03 UTC (rev 16604)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java 2010-03-18
15:05:50 UTC (rev 16605)
@@ -23,8 +23,6 @@
package org.richfaces.cdk.model;
-import org.richfaces.cdk.CdkException;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -53,12 +51,6 @@
this.converterForClass = converterForClass;
}
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
- return visitor.visit(this, param);
- }
-
public void accept(Visitor visitor) {
visitor.visitConverter(this);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-03-18
15:04:03 UTC (rev 16604)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-03-18
15:05:50 UTC (rev 16605)
@@ -31,7 +31,13 @@
import org.richfaces.cdk.ModelValidator;
import org.richfaces.cdk.NamingConventions;
import org.richfaces.cdk.apt.SourceUtils;
-import org.richfaces.cdk.model.*;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ComponentModel;
+import org.richfaces.cdk.model.DescriptionGroup;
+import org.richfaces.cdk.model.FacetModel;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.RenderKitModel;
+import org.richfaces.cdk.model.RendererModel;
import org.richfaces.cdk.util.Strings;
import java.util.Collection;