Author: alexsmirnov
Date: 2010-12-27 20:13:35 -0500 (Mon, 27 Dec 2010)
New Revision: 20823
Modified:
branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestClass.java
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestInterface.java
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/TestClass.java
Log:
CODING IN PROGRESS - issue RF-9323: CDK annotation @RendererSpecificComponent.attributes
doesn't work
https://issues.jboss.org/browse/RF-9323
Modified:
branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
===================================================================
---
branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-12-28
00:01:35 UTC (rev 20822)
+++
branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-12-28
01:13:35 UTC (rev 20823)
@@ -82,7 +82,7 @@
if (ElementKind.METHOD.equals(childElement.getKind())) {
processMethod(properties, childElement, annotated);
} else if (ElementKind.FIELD.equals(childElement.getKind())) {
- processFiled(properties, childElement);
+// processFiled(properties, childElement);
}
// TODO - merge properties with same name ?
@@ -128,7 +128,6 @@
Map<String,BeanProperty> getBeanProperties(TypeElement type){
List<? extends Element> members =
this.processingEnv.getElementUtils().getAllMembers(type);
// extract all getters/setters.
- Iterable<? extends ExecutableElement> gettersAndSetters =
Iterables.filter(Iterables.filter(members,
BEAN_PROPERTY_PREDICATE),ExecutableElement.class);
Map<String,BeanProperty> result = Maps.newHashMap();
for (Element element : members) {
if (ElementKind.METHOD.equals(element.getKind())){
@@ -139,7 +138,7 @@
if(result.containsKey(propertyName)){
// Merge property with existed one.
BeanProperty beanProperty = result.get(propertyName);
- processingEnv.getElementUtils().
+// processingEnv.getElementUtils().
} else {
}
@@ -149,15 +148,6 @@
}
}
}
- // Merge all getter/setter methods.
- for (ExecutableElement accestor : gettersAndSetters) {
- String name =
PropertyUtils.methodToName(accestor.getSimpleName().toString());
- if(result.containsKey(name)){
-
- } else {
-
- }
- }
return result;
}
@@ -209,18 +199,6 @@
return builder.toString();
}
- private void processFiled(Set<BeanProperty> properties, Element childElement)
{
- AptBeanProperty property = new
AptBeanProperty(childElement.getSimpleName().toString());
-
- property.type = asClassDescription(childElement.asType());
- property.getter = childElement;
-
- // TODO - find getter/setter, check them for abstract.
- property.exists = true;
-
- properties.add(property);
- }
-
private void processMethod(Set<BeanProperty> properties, Element childElement,
boolean annotated) {
ExecutableElement method = (ExecutableElement) childElement;
boolean exists = !isAbstract(method);
@@ -247,7 +225,7 @@
AptBeanProperty property = new AptBeanProperty(name);
property.type = asClassDescription(propertyType);
- property.getter = childElement;
+ property.getter = (ExecutableElement) childElement;
property.exists = exists;
properties.add(property);
Modified:
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestClass.java
===================================================================
---
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestClass.java 2010-12-28
00:01:35 UTC (rev 20822)
+++
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestClass.java 2010-12-28
01:13:35 UTC (rev 20823)
@@ -25,10 +25,21 @@
package org.richfaces.cdk.apt;
+import org.richfaces.cdk.apt.TestMethodAnnotation;
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">Java Bean to test bean properties
processor.
+ * that class contains next properties:
+ * <ol>
+ * <li>r/w concreteValue, type String, annotated with {@link TestMethodAnnotation}
"setter"</li>
+ * <li> r/w inheritedValue, type String, inherited from {@link
PropertyTestInterface}, annotated {@link TestMethodAnnotation} "inherited"
</li>
+ * <li> abstract r/w value, inherited from {@link TestInterface},{@link
TestMethodAnnotation} "baz"</li>
+ * <li> r readOnly, type Integer, inherited from {@link TestClass}</li>
+ * <li> w writeOnly, type Integer, inherited from {@link TestClass}</li>
+ * <li> wrongValue that should be ignored with warning message.</li>
+ * </ol>
+ * </p>
* @author asmirnov(a)exadel.com
- *
*/
public class PropertyTestClass extends TestClass implements TestInterface,
PropertyTestInterface {
private String concreteValue;
Modified:
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestInterface.java
===================================================================
---
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestInterface.java 2010-12-28
00:01:35 UTC (rev 20822)
+++
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/PropertyTestInterface.java 2010-12-28
01:13:35 UTC (rev 20823)
@@ -25,6 +25,8 @@
package org.richfaces.cdk.apt;
+import org.richfaces.cdk.apt.TestMethodAnnotation;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -32,6 +34,7 @@
*/
public interface PropertyTestInterface {
+ @TestMethodAnnotation("inherited")
public String getInheritedValue();
public void setInheritedValue(String value);
Modified:
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/TestClass.java
===================================================================
---
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/TestClass.java 2010-12-28
00:01:35 UTC (rev 20822)
+++
branches/RF-9323/cdk/generator/src/test/resources/org/richfaces/cdk/apt/TestClass.java 2010-12-28
01:13:35 UTC (rev 20823)
@@ -37,7 +37,7 @@
return null;
}
- public void setWriteOnly(){
+ public void setWriteOnly(Boolean value){
}
}