Author: alexsmirnov
Date: 2010-07-12 17:49:59 -0400 (Mon, 12 Jul 2010)
New Revision: 17985
Added:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/renderkit/RendererUtils.java
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
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/xmlconfig/model/FacetBean.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/pom.xml
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/MethodMetadata.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
Log:
Resolved - issue RF-8889: CDK: @Facet leads to incorrect faces-config.xml
https://jira.jboss.org/secure/browse/RF-8889
Resolved
https://jira.jboss.org/browse/RF-8907
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-07-12
19:18:30 UTC (rev 17984)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-07-12
21:49:59 UTC (rev 17985)
@@ -1,6 +1,7 @@
package org.richfaces.cdk.apt.processors;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -161,9 +162,6 @@
}
private List<ClassName> getSignature(Signature signature, AnnotationValue
signatureMirror) {
- if (signature == null) {
- return null;
- }
String returnType;
try {
@@ -173,14 +171,14 @@
returnType = returnTypeMirror.toString();
}
- if (signature != null && SIGNATURE_NONE_CLASS_NAME.equals(returnType)) {
+ if (signature != null && !SIGNATURE_NONE_CLASS_NAME.equals(returnType))
{
return getSignatureParams(signature, signatureMirror);
// signature parameters always should be replaced.
// TODO - set method return type.
}
- return null;
+ return Collections.emptyList();
}
private List<ClassName> getSignatureParams(Signature signature, AnnotationValue
signatureMirror) {
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-07-12
19:18:30 UTC (rev 17984)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-07-12
21:49:59 UTC (rev 17985)
@@ -384,6 +384,9 @@
} else if
("javax.el.MethodExpression".equals(attribute.getType().getName())) {
attribute.setBindingAttribute(true);
}
+ if(attribute.isBindingAttribute() &&
attribute.getSignature().isEmpty()){
+ log.error("Signature for method expression attribute
"+attribute.getName()+" has not been set");
+ }
// Check "generate" flag.
if (generatedComponent) {
// TODO Attribute should be only generated if it does not exist or abstract
in the base class.
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java 2010-07-12
19:18:30 UTC (rev 17984)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java 2010-07-12
21:49:59 UTC (rev 17985)
@@ -24,6 +24,8 @@
package org.richfaces.cdk.xmlconfig.model;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
@@ -33,6 +35,9 @@
*
* @author asmirnov(a)exadel.com
*/
+@XmlType(name = "faces-config-facetType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,
+ propOrder = {"name", "extension"})
+(a)XmlJavaTypeAdapter(FacetAdapter.class)
public class FacetBean extends ExtensibleBean<FacetBean.FacetExtension> {
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/pom.xml
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/pom.xml 2010-07-12
19:18:30 UTC (rev 17984)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/pom.xml 2010-07-12
21:49:59 UTC (rev 17985)
@@ -22,7 +22,7 @@
<inherited>false</inherited>
<configuration>
<options>
- <rendererUtils>#built-in</rendererUtils>
+
<rendererUtils>org.richfaces.cdk.test.renderkit.RendererUtils</rendererUtils>
</options>
</configuration>
</execution>
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/MethodMetadata.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/MethodMetadata.java 2010-07-12
19:18:30 UTC (rev 17984)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/MethodMetadata.java 2010-07-12
21:49:59 UTC (rev 17985)
@@ -1,12 +1,33 @@
package org.richfaces;
+import javax.el.MethodExpression;
+import javax.faces.el.MethodBinding;
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.TagAttribute;
public class MethodMetadata extends Metadata {
+ public MethodMetadata(TagAttribute attribute, Class<String> class1,
Class<Integer> class2) {
+ // TODO Auto-generated constructor stub
+ }
+
+ public MethodMetadata(TagAttribute attribute, Class<String> class1) {
+ // TODO Auto-generated constructor stub
+ }
+
@Override
public void applyMetadata(FaceletContext ctx, Object instance) {
}
+ protected MethodBinding getMethodBinding(FaceletContext ctx) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected MethodExpression getMethodExpression(FaceletContext ctx) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-07-12
19:18:30 UTC (rev 17984)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-07-12
21:49:59 UTC (rev 17985)
@@ -25,8 +25,12 @@
import java.util.List;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponentBase;
import javax.faces.component.ValueHolder;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.ValueBinding;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Description;
@@ -34,6 +38,7 @@
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.RendererSpecificComponent;
+import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.test.event.TestEvent;
@@ -49,7 +54,7 @@
family="org.richfaces.Test",
description=@Description(displayName="Test
Component",largeIcon="large.gif",smallIcon="spall.png"),
generate="org.richfaces.cdk.test.component.UITestComponent",
- facets=@Facet(name="caption"),
+
facets=@Facet(name="caption",generate=true,description=@Description("Caption
Facet")),
fires=TestEvent.class,
interfaces=ValueHolder.class,
components={
@@ -84,4 +89,16 @@
*/
@Attribute
public abstract void setBarValue(List<Object> bar);
+
+ @Attribute(signature = @Signature(parameters = String.class, returnType =
Boolean.class))
+ public abstract MethodExpression getMethodExpressionListener();
+
+ @Attribute(signature = @Signature(parameters = {String.class,Integer.class},
returnType = int.class))
+ public abstract MethodBinding getMethodBindingListener();
+
+ @Attribute(required=true)
+ public abstract ValueExpression getValueExpressionProperty();
+
+ @Attribute(required=true)
+ public abstract ValueBinding getValueBindingProperty();
}
Added:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/renderkit/RendererUtils.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/renderkit/RendererUtils.java
(rev 0)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/renderkit/RendererUtils.java 2010-07-12
21:49:59 UTC (rev 17985)
@@ -0,0 +1,39 @@
+package org.richfaces.cdk.test.renderkit;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+public class RendererUtils {
+
+ public static boolean shouldRenderAttribute(Object value) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public static void renderPassThroughAttributes(FacesContext facesContext, UIComponent
component,
+ Attributes passThroughAttributes0) throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+ public static Attributes attributes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public class Attributes {
+
+ public Attributes generic(String string, String string2,String ...events) {
+ return this;
+ }
+
+ public Attributes bool(String string, String string2) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ }
+
+}
Property changes on:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/renderkit/RendererUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain