Author: alexsmirnov
Date: 2010-07-23 20:25:35 -0400 (Fri, 23 Jul 2010)
New Revision: 18225
Added:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/model/
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/model/TestModel.java
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ClassGeneratorModule.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/templatecompiler/RendererTemplateParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taghandler.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/testmodel/BehaviorBeanTest.xml
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
Log:
work in progress
https://jira.jboss.org/browse/RF-8907
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ClassGeneratorModule.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ClassGeneratorModule.java 2010-07-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ClassGeneratorModule.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -23,16 +23,21 @@
package org.richfaces.cdk.generate.java;
+import java.util.Map;
+
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.generate.freemarker.CdkConfiguration;
+import org.richfaces.cdk.generate.freemarker.DefaultImports;
import org.richfaces.cdk.generate.freemarker.FreeMakerUtils;
import org.richfaces.cdk.generate.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.generate.freemarker.LibraryModelWrapper;
import org.richfaces.cdk.generate.java.taghandler.ListenerTagHandlerGenerator;
import org.richfaces.cdk.generate.java.taghandler.TagHandlerWriter;
+import com.google.common.collect.ImmutableMap;
import com.google.inject.AbstractModule;
import com.google.inject.PrivateBinder;
+import com.google.inject.TypeLiteral;
import com.google.inject.multibindings.Multibinder;
import freemarker.template.ObjectWrapper;
@@ -66,6 +71,8 @@
privateBinder.expose(FreeMarkerRenderer.class).annotatedWith(LibraryModel.class);
privateBinder.bind(ObjectWrapper.class).to(LibraryModelWrapper.class);
privateBinder.bind(FreeMakerUtils.class);
+ privateBinder.bind(new
TypeLiteral<Map<String,String>>(){}).annotatedWith(DefaultImports.class).toInstance(ImmutableMap.of("util","util.ftl"));
+
}
}
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-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -258,7 +258,6 @@
verifyComponentAttributes(library, parentComponent, verified);
for (PropertyBase parentAttribute : parentComponent.getAttributes())
{
PropertyBase attribute =
component.getOrCreateAttribute(parentAttribute.getName());
- // TODO - do not owerride properties ?
attribute.merge(parentAttribute);
// TODO Check generate status. Attribute should not be generated
if the parent component
// represents
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-07-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -126,13 +126,14 @@
private MethodSignature parseSignature(String signatureString) {
List<ClassName> parameters = Lists.newArrayList();
- MethodSignature signature = new MethodSignature();
+ MethodSignature signature = null;
if (!Strings.isEmpty(signatureString)) {
Matcher parametersStringMatcher =
PARAMETERS_STRING_PATTERN.matcher(signatureString);
if (!parametersStringMatcher.find()) {
throw new IllegalArgumentException(MessageFormat.format("Signature
string {0} cannot be parsed!",
signatureString));
}
+ signature = new MethodSignature();
signature.setReturnType(ClassName.parseName(parametersStringMatcher.group(1)));
String parametersString = parametersStringMatcher.group(3);
if (parametersString.trim().length() != 0) {
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-07-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -44,10 +44,9 @@
/**
* <p class="changed_added_4_0">
- * That class resolves entities used by CDK ( standard JSF schemas, extensions,
- * configuration fragments.)
+ * That class resolves entities used by CDK ( standard JSF schemas, extensions,
configuration fragments.)
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
*/
public class CdkEntityResolver implements EntityResolver2 {
@@ -64,41 +63,37 @@
private static final String ATTRIBUTES_PREFIX =
"META-INF/cdk/attributes/";
private static final String SYSTEM_PREFIX = "/META-INF/schema";
private static final String URN_SYSTEM = "urn:system:";
- private static final ImmutableMap<String, String> SYSTEM_ENTITIES =
ImmutableMap
- .<String, String>builder()
- .put("http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd",
- URN_SYSTEM + "/web-facesconfig_2_0.xsd")
- .put("http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd",
- URN_SYSTEM + "/web-facesuicomponent_2_0.xsd")
- .put("http://java.sun.com/xml/ns/javaee/web-partialresponse_2_0.xsd",
- URN_SYSTEM + "/web-partialresponse_2_0.xsd")
- .put("http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd",
- URN_SYSTEM + "/web-facesconfig_1_2.xsd")
- .put("http://java.sun.com/xml/ns/javaee/javaee_5.xsd",
- URN_SYSTEM + "/javaee_5.xsd")
- .put(
+ private static final ImmutableMap<String, String> SYSTEM_ENTITIES =
+ ImmutableMap.<String, String>
builder().put("http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0...;,
+ URN_SYSTEM + "/web-facesconfig_2_0.xsd").put(
+ "http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd",
+ URN_SYSTEM + "/web-facesuicomponent_2_0.xsd").put(
+ "http://java.sun.com/xml/ns/javaee/web-partialresponse_2_0.xsd",
+ URN_SYSTEM + "/web-partialresponse_2_0.xsd").put(
+ "http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd",
URN_SYSTEM + "/web-facesconfig_1_2.xsd").put(
+ "http://java.sun.com/xml/ns/javaee/javaee_5.xsd", URN_SYSTEM +
"/javaee_5.xsd").put(
"http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd",
- URN_SYSTEM + "/javaee_web_services_1_2.xsd")
-
.put("http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd",
URN_SYSTEM + "/javaee_web_services_client_1_2.xsd")
- .put("http://www.w3.org/2001/03/XMLSchema.dtd", URN_SYSTEM +
"/XMLSchema.dtd")
- .put("http://www.w3.org/2001/03/xml.xsd", URN_SYSTEM +
"/xml.xsd")
- .put("http://www.w3.org/2001/xml.xsd", URN_SYSTEM +
"/xml.xsd")
- .put("http://richfaces.org/cdk/cdk-template.xsd", URN_SYSTEM +
"/cdk-template.xsd")
- .put("http://richfaces.org/cdk/xhtml-el.xsd", URN_SYSTEM +
"/xhtml-el.xsd").build();
+ URN_SYSTEM + "/javaee_web_services_1_2.xsd").put(
+
"http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd",
+ URN_SYSTEM +
"/javaee_web_services_client_1_2.xsd").put("http://www.w3.org/2001/03/XMLSchema.dtd",
+ URN_SYSTEM +
"/XMLSchema.dtd").put("http://www.w3.org/2001/03/xml.xsd", URN_SYSTEM
+ "/xml.xsd").put(
+ "http://www.w3.org/2001/xml.xsd", URN_SYSTEM +
"/xml.xsd").put("http://richfaces.org/cdk/cdk-template.xsd",
+ URN_SYSTEM + "/cdk-template.xsd")
+ .put("http://richfaces.org/cdk/xhtml-el.xsd", URN_SYSTEM +
"/xhtml-el.xsd").build();
-
@Inject
private CdkClassLoader loader;
- @Inject @Source(Sources.FACES_CONFIGS)
+ @Inject
+ @Source(Sources.FACES_CONFIGS)
private FileManager facesConfigFolders;
- @Inject @Source(Sources.RENDERER_TEMPLATES)
+ @Inject
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager rendererTemplatesFolders;
/*
* (non-Javadoc)
- *
- * @see org.xml.sax.ext.EntityResolver2#getExternalSubset(java.lang.String,
- * java.lang.String)
+ *
+ * @see org.xml.sax.ext.EntityResolver2#getExternalSubset(java.lang.String,
java.lang.String)
*/
@Override
public InputSource getExternalSubset(String name, String baseURI) throws
SAXException, IOException {
@@ -109,9 +104,9 @@
/*
* (non-Javadoc)
- *
- * @see org.xml.sax.ext.EntityResolver2#resolveEntity(java.lang.String,
- * java.lang.String, java.lang.String, java.lang.String)
+ *
+ * @see org.xml.sax.ext.EntityResolver2#resolveEntity(java.lang.String,
java.lang.String, java.lang.String,
+ * java.lang.String)
*/
@Override
public InputSource resolveEntity(String name, String publicId, String baseURI, String
systemId)
@@ -138,9 +133,8 @@
/*
* (non-Javadoc)
- *
- * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
- * java.lang.String)
+ *
+ * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
*/
@Override
public InputSource resolveEntity(String publicId, String systemId) throws
SAXException, IOException {
@@ -153,7 +147,7 @@
return entity;
}
- protected InputSource resolveSystemId(String systemId) throws FileNotFoundException
{
+ protected InputSource resolveSystemId(String systemId) throws IOException {
InputSource entity = null;
// first step - convert known system url's:
@@ -175,16 +169,11 @@
InputStream inputStream = null;
if (null != url) {
- try {
- inputStream = url.openStream();
- } catch (IOException e) {
- // Do nothnig.
- }
-
- if (inputStream != null) {
- entity = new InputSource(inputStream);
- entity.setSystemId(url.toString());
- }
+ inputStream = url.openStream();
+ entity = new InputSource(inputStream);
+ entity.setSystemId(url.toString());
+ } else {
+ throw new FileNotFoundException("Resource not found in generator
class path: " + SYSTEM_PREFIX + path);
}
} else if (systemIdInternal.startsWith(URN_RESOURCE)) {
@@ -195,16 +184,11 @@
InputStream inputStream = null;
if (null != url) {
- try {
- inputStream = url.openStream();
- } catch (IOException e) {
- // Do nothnig.
- }
-
- if (inputStream != null) {
- entity = new InputSource(inputStream);
- entity.setSystemId(url.toString());
- }
+ inputStream = url.openStream();
+ entity = new InputSource(inputStream);
+ entity.setSystemId(url.toString());
+ } else {
+ throw new FileNotFoundException("Resource not found in project class
path: " + path);
}
} else if (systemIdInternal.startsWith(URN_ATTRIBUTES)) {
@@ -218,18 +202,18 @@
}
if (null != inputStream) {
entity = new InputSource(inputStream);
+ } else {
+ throw new FileNotFoundException("Resource not found in class path:
" + ATTRIBUTES_PREFIX + path);
}
} else if (systemIdInternal.startsWith(URN_CONFIG)) {
// Config folder.
String path = systemIdInternal.substring(URN_CONFIG.length());
-
entity = getProjectInputSource(facesConfigFolders, path);
} else if (systemIdInternal.startsWith(URN_TEMPLATES)) {
// Templates folder.
String path = systemIdInternal.substring(URN_TEMPLATES.length());
-
entity = getProjectInputSource(rendererTemplatesFolders, path);
}
@@ -248,9 +232,9 @@
if (null != configFile && configFile.exists()) {
InputStream inputStream = new FileInputStream(configFile);
-
entity = new InputSource(inputStream);
-
+ } else {
+ throw new FileNotFoundException("File not found in project : " +
path);
}
return entity;
Modified:
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taghandler.ftl
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taghandler.ftl 2010-07-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taghandler.ftl 2010-07-24
00:25:35 UTC (rev 18225)
@@ -2,17 +2,29 @@
package ${tag.targetClass.package};
-import javax.faces.view.facelets.*;
-import org.richfaces.MethodMetadata;
+import java.io.Serializable;
+import javax.el.MethodExpression;
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.MethodNotFoundException;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.${model}Config;
+import javax.faces.view.facelets.TagAttribute;
import ${model.targetClass};
-<#list model.generatedAttributes as prop><#if
(!prop.signature.empty)><#list prop.signature as class>import ${class.name};
-</#list></#if></#list>
-
+import ${tag.baseClass};
+<#assign useMetaRule=false />
+<#list model.tagAttributes as prop><#if prop.signature?exists><#list
prop.signature.parameters as class>import ${class.name};
+</#list></#if><#if (prop.binding || prop.bindingAttribute)><#assign
useMetaRule=true /></#if></#list>
public class ${tag.targetClass.simpleName} extends ${tag.baseClass.simpleName} {
- private static final ${tag.targetClass.simpleName}MetaRule META_RULE = new
${tag.targetClass.simpleName}MetaRule();
-
public ${tag.targetClass.simpleName}(${model}Config config) {
super(config);
<#list model.requiredAttributes as
prop>getRequiredAttribute("${prop.name}");
@@ -20,27 +32,80 @@
}
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset m = super.createMetaRuleset(type);
- m.addRule(META_RULE);
- return m;
- }
+<#if useMetaRule=true>
+<#assign useMethodBinding=false />
+ private static final MetaRule META_RULE = new MetaRule(){
- static class ${tag.targetClass.simpleName}MetaRule extends MetaRule{
-
- public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget
meta) {
+ public Metadata applyRule(String name, final TagAttribute attribute,
MetadataTarget meta) {
if (meta.isTargetInstanceOf(${model.targetClass.simpleName}.class)) {
<#list model.tagAttributes as prop><#if (prop.binding ||
prop.bindingAttribute)>
if ("${prop.name}".equals(name)) {
- return new MethodMetadata(attribute<#if
(!prop.signature.empty)><#list prop.signature as class>,
${class.simpleName}.class</#list></#if>) {
+ return new Metadata() {
+ private final Class<?>[] SIGNATURE={<#if
prop.signature?exists><(a)util.concat seq=prop.signature.parameters;
parameter>${parameter.simpleName}.class</(a)util.concat></#if>};
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((${model.targetClass.simpleName})
instance).${prop.setterName}(<#if
(prop.isBinging)>getMethodBinding(ctx));<#else>getMethodExpression(ctx));</#if>
+ ((${model.targetClass.simpleName})
instance).${prop.setterName}(getValue(ctx));
}
+ <#if (prop.isBinging)>
+ <#assign useMethodBinding=true />
+ @SuppressWarnings("deprecation")
+ private MethodBinding getValue(FaceletContext ctx){
+ return new
MethodBindingWrapper(attribute.getMethodExpression(ctx, <#if
prop.signature?exists>${prop.signature.returnType.simpleName}.class<#else>null</#if>,
SIGNATURE));
+ }
+ <#else>
+ private MethodExpression getValue(FaceletContext ctx){
+ return attribute.getMethodExpression(ctx, <#if
prop.signature?exists>${prop.signature.returnType.simpleName}.class<#else>null</#if>,
SIGNATURE);
+ }
+ </#if>
};
}
</#if></#list>
}
return null;
}
+ };
+
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset m = super.createMetaRuleset(type);
+ m.addRule(META_RULE);
+ return m;
}
+
+<#if useMethodBinding=true>
+ @SuppressWarnings({ "serial", "deprecation" })
+ public static final class MethodBindingWrapper extends
+ MethodBinding implements Serializable {
+
+ private final MethodExpression m;
+
+ public MethodBindingWrapper(MethodExpression m) {
+ this.m = m;
+ }
+
+ public Class getType(FacesContext context)
+ throws MethodNotFoundException {
+ try {
+ return m.getMethodInfo(context.getELContext()).getReturnType();
+ } catch (javax.el.MethodNotFoundException e) {
+ throw new MethodNotFoundException(e.getMessage(), e.getCause());
+ } catch (ELException e) {
+ throw new EvaluationException(e.getMessage(), e.getCause());
+ }
+ }
+
+ public Object invoke(FacesContext context, Object[] params)
+ throws EvaluationException, MethodNotFoundException {
+ try {
+ return m.invoke(context.getELContext(), params);
+ } catch (javax.el.MethodNotFoundException e) {
+ throw new MethodNotFoundException(e.getMessage(), e.getCause());
+ } catch (ELException e) {
+ throw new EvaluationException(e.getMessage(), e.getCause());
+ }
+ }
+
+ public String getExpressionString() {
+ return m.getExpressionString();
+ }
+ }
+</#if></#if>
}
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java 2010-07-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -29,9 +29,9 @@
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
+import java.util.Map;
import org.junit.Assert;
-import org.richfaces.cdk.As;
import org.richfaces.cdk.CdkTestBase;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Logger;
@@ -39,6 +39,8 @@
import org.richfaces.cdk.Output;
import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.generate.freemarker.CdkConfiguration;
+import org.richfaces.cdk.generate.freemarker.DefaultImports;
+import org.richfaces.cdk.generate.freemarker.FreeMakerUtils;
import org.richfaces.cdk.generate.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.generate.freemarker.LibraryModelWrapper;
import org.richfaces.cdk.model.ClassName;
@@ -47,7 +49,10 @@
import org.richfaces.cdk.model.ModelElementBase;
import org.richfaces.cdk.model.PropertyBase;
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Binder;
import com.google.inject.Inject;
+import com.google.inject.TypeLiteral;
import freemarker.template.ObjectWrapper;
@@ -58,7 +63,6 @@
public abstract class AbstractClassGeneratorTest extends CdkTestBase {
@Inject
- @As(CdkConfiguration.class)
@LibraryModel
protected FreeMarkerRenderer configuration;
@@ -74,8 +78,16 @@
@Inject
- @As(LibraryModelWrapper.class)
protected ObjectWrapper wrapper;
+
+ @Override
+ public void configure(Binder binder) {
+ super.configure(binder);
+
binder.bind(FreeMarkerRenderer.class).annotatedWith(LibraryModel.class).to(CdkConfiguration.class);
+ binder.bind(ObjectWrapper.class).to(LibraryModelWrapper.class);
+ binder.bind(FreeMakerUtils.class);
+ binder.bind(new
TypeLiteral<Map<String,String>>(){}).annotatedWith(DefaultImports.class).toInstance(ImmutableMap.of("util","util.ftl"));
+ }
protected static PropertyBase addAttribute(ModelElementBase model, String
attributeName, Class<?> type,
boolean generate) {
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java 2010-07-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -52,20 +52,12 @@
@Inject
private Logger log;
- public TagHandlerClassGenerator getGenerator() {
- return generator;
- }
- public void setGenerator(TagHandlerClassGenerator generator) {
- this.generator = generator;
- }
-
@Test
public void testGetOutputFileBehavior() throws Exception {
final StringWriter outputWriter = new StringWriter();
expect(output.createOutput((String) anyObject(),
anyInt())).andReturn(outputWriter);
replay(output);
-
ComponentModel model = ComponentClassGeneratorTest.createComponent();
library.getComponents().add(model);
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-07-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -128,7 +128,7 @@
assertNotNull(actionProperty.getSignature());
assertEquals(0, actionProperty.getSignature().getParameters().size());
- assertEquals(String.class.getName(),
actionProperty.getSignature().getReturnType());
+ assertEquals(String.class.getName(),
actionProperty.getSignature().getReturnType().toString());
}
/**
@@ -141,7 +141,7 @@
assertNotNull(actionListenerProperty);
assertNoEventNames(actionListenerProperty);
- assertEquals(Lists.newArrayList(new ClassName(ActionEvent.class)),
actionListenerProperty.getSignature());
+ assertEquals(Lists.newArrayList(new ClassName(ActionEvent.class)),
actionListenerProperty.getSignature().getParameters());
}
/**
@@ -157,7 +157,7 @@
ArrayList<ClassName> expectedSignature =
Lists.newArrayList(new ClassName(int.class), new ClassName(String.class), new
ClassName(Validator.class));
- assertEquals(expectedSignature, coolMethodProperty.getSignature());
+ assertEquals(expectedSignature,
coolMethodProperty.getSignature().getParameters());
}
private void checkDummyComponentImportedAttribute(PropertyBase importedAttribute,
Class<?> type) {
Modified:
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/testmodel/BehaviorBeanTest.xml
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/testmodel/BehaviorBeanTest.xml 2010-07-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/testmodel/BehaviorBeanTest.xml 2010-07-24
00:25:35 UTC (rev 18225)
@@ -13,7 +13,6 @@
<cdk:pass-through>false</cdk:pass-through>
<cdk:read-only>false</cdk:read-only>
<cdk:required>false</cdk:required>
- <cdk:signature/>
</attribute-extension>
</attribute>
<property>
@@ -26,7 +25,6 @@
<cdk:pass-through>false</cdk:pass-through>
<cdk:read-only>false</cdk:read-only>
<cdk:required>false</cdk:required>
- <cdk:signature/>
</property-extension>
</property>
<behavior-extension>
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-23
19:43:09 UTC (rev 18224)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -41,6 +41,7 @@
import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.test.event.TestEvent;
+import org.richfaces.cdk.test.model.TestModel;
/**
* <p class="changed_added_4_0">
@@ -96,9 +97,9 @@
@Attribute(signature = @Signature(parameters = {String.class,Integer.class},
returnType = int.class))
public abstract MethodBinding getMethodBindingListener();
- @Attribute(required=true)
+ @Attribute(required=true,signature=(a)Signature(returnType=TestModel.class))
public abstract ValueExpression getValueExpressionProperty();
- @Attribute(required=true)
+
@Attribute(required=true,signature=(a)Signature(returnType=List.class,parameters={String.class,int.class}))
public abstract ValueBinding getValueBindingProperty();
}
Added:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/model/TestModel.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/model/TestModel.java
(rev 0)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/model/TestModel.java 2010-07-24
00:25:35 UTC (rev 18225)
@@ -0,0 +1,5 @@
+package org.richfaces.cdk.test.model;
+
+public class TestModel {
+
+}
Property changes on:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/model/TestModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain