Author: maksimkaszynski
Date: 2008-04-21 10:49:38 -0400 (Mon, 21 Apr 2008)
New Revision: 8016
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/ComponentStateManager.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java
trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
Log:
http://jira.jboss.com/jira/browse/RF-1343
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java 2008-04-21
14:49:29 UTC (rev 8015)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java 2008-04-21
14:49:38 UTC (rev 8016)
@@ -62,6 +62,11 @@
JavaField field = new JavaField(propertyClass, "_" + name, defaultvalue);
field.getComments().add(new JavaComment(propertyBean.getXmlEncodedDescription()));
field.getModifiers().add(JavaModifier.PRIVATE);
+
+ if (propertyBean.isTransient()) {
+ field.addModifier(JavaModifier.TRANSIENT);
+ }
+
handleDeprecation(field.getType(), field);
return field;
}
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java 2008-04-21
14:49:29 UTC (rev 8015)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java 2008-04-21
14:49:38 UTC (rev 8016)
@@ -106,7 +106,9 @@
JavaField field = getField(propertyBean, configuration);
JavaField field2 = new JavaField(boolean.class, field.getName() + "Set",
"false");
field2.addModifier(JavaModifier.PRIVATE);
-
+ if (propertyBean.isTransient()) {
+ field2.addModifier(JavaModifier.TRANSIENT);
+ }
JavaMethod accessor = getAccessor(configuration, propertyBean, field);
MethodBody accessorMethodBody;
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/ComponentStateManager.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/ComponentStateManager.java 2008-04-21
14:49:29 UTC (rev 8015)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/ComponentStateManager.java 2008-04-21
14:49:38 UTC (rev 8016)
@@ -101,7 +101,9 @@
public ComponentStateDescriptor getDesriptor(PropertyBean propertyBean, JavaField field)
{
Set<JavaModifier> modifiers = field.getModifiers();
- if (modifiers.contains(JavaModifier.FINAL) ||
modifiers.contains(JavaModifier.STATIC)){
+ if (modifiers.contains(JavaModifier.FINAL)
+ || modifiers.contains(JavaModifier.STATIC)
+ || modifiers.contains(JavaModifier.TRANSIENT)){
return null;
}
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java 2008-04-21
14:49:29 UTC (rev 8015)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java 2008-04-21
14:49:38 UTC (rev 8016)
@@ -35,7 +35,9 @@
PROTECTED,
PUBLIC,
STATIC,
- FINAL;
+ FINAL,
+ TRANSIENT
+ ;
public String toString() {
return super.toString().toLowerCase();
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2008-04-21
14:49:29 UTC (rev 8015)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2008-04-21
14:49:38 UTC (rev 8016)
@@ -113,12 +113,17 @@
#else
#if (!${prop.simpleType})
if (this._${prop.name} != null) {
- #end
-
comp.${prop.setterName}(this._${prop.name});
-
- #if (!${prop.simpleType})
}
+ #else
+ #set ($propertyClass = ${prop.boxingClass})
+ $propertyClass __${prop.name} = ($propertyClass) getFacesContext().
+ getApplication().
+ getExpressionFactory().
+ coerceToType(this._${prop.name},
+ ${propertyClass}.class);
+ comp.${prop.setterName}(__${prop.name}.${prop.classname}Value());
+
#end
#end
#end