Author: alexsmirnov
Date: 2010-12-30 18:14:04 -0500 (Thu, 30 Dec 2010)
New Revision: 20852
Modified:
branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.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/model/validator/ValidatorImpl.java
===================================================================
---
branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-12-30
20:35:22 UTC (rev 20851)
+++
branches/RF-9323/cdk/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-12-30
23:14:04 UTC (rev 20852)
@@ -483,8 +483,8 @@
return true;
}
- protected void verifyAttribute(PropertyBase attribute, FacesComponent component) {
- // Check name.
+ protected void verifyAttribute(PropertyBase attribute, FacesComponent component) {
+ // Check name.
if (Strings.isEmpty(attribute.getName())) {
log.error("No name for attribute " + attribute);
return;
@@ -513,6 +513,14 @@
if (Boolean.TRUE.equals(component.getGenerate())) {
// TODO Attribute should be only generated if it does not exist or abstract
in the base class.
// Step one - check base class
+ SourceUtils sourceUtils = sourceUtilsProvider.get();
+ if(null == attribute.getGenerate()){
+ if(sourceUtils.isClassExists(component.getBaseClass())){
+
attribute.setGenerate(!sourceUtils.getBeanProperty(component.getBaseClass(),
attribute.getName()).isExists());
+ } else {
+ attribute.setGenerate(true);
+ }
+ }
} else {
attribute.setGenerate(false);
}