/**
* Creates a transducer if this class is bound to a text in XML.
*/
private Transducer calcTransducer() {
RuntimeValuePropertyInfo valuep=null;
if(hasAttributeWildcard())
return null; // has attribute wildcard. Can't be handled as a leaf
for (RuntimeClassInfoImpl ci = this; ci != null; ci = ci.getBaseClass()) {
for( RuntimePropertyInfo pi : ci.getProperties() )
if(pi.kind()==PropertyKind.VALUE) {
valuep = (RuntimeValuePropertyInfo)pi;
} else {
// this bean has something other than a value
return null;
}
}
if(valuep==null)
return null;
if( !valuep.getTarget().isSimpleType() )
return null; // if there's an error, recover from it by returning null.
return new TransducerImpl(getClazz(),TransducedAccessor.get(
((RuntimeModelBuilder)builder).context,valuep));
}