&& type != null
&& !(type == Table.class
&& "TableColumn"
.equals(child.getName()) && Table.class
.isInstance(directTarget))) {
throw new XWTException(child.getName()
+ " cannot be a content of "
+ type.getName() + " "
+ target.getClass().getName() + "."
+ property.getName());
}
if (value instanceof IDynamicBinding) {
((IDynamicBinding) value).setType(attrName);
}
}
}
}
}
}
if (contentValue != null && value == null
&& !IConstants.XAML_COMMAND.equalsIgnoreCase(propertyName)) {
if (property.getType().isInstance(Class.class)) {
int index = contentValue.lastIndexOf(':');
if (index != -1) {
String prefix = contentValue.substring(0, index);
contentValue = findNamespace(attribute, prefix)
+ contentValue.substring(index);
}
}
value = loader.convertFrom(property.getType(), contentValue);
}
if (!usingExistingValue) {
if (value != null) {
Class<?> propertyType = property.getType();
if (!propertyType.isAssignableFrom(value.getClass())
|| (value instanceof IBinding && !(IBinding.class
.isAssignableFrom(propertyType)))) {
Object orginalValue = value;
IConverter converter = loader.findConvertor(value
.getClass(), propertyType);
if (converter != null) {
value = converter.convert(value);
if (value != null
&& orginalValue instanceof IBinding
&& !propertyType.isAssignableFrom(value
.getClass())) {
converter = loader.findConvertor(value.getClass(),
propertyType);
if (converter != null) {
value = converter.convert(value);
} else {
LoggerManager.log(new XWTException("Convertor "
+ value.getClass().getSimpleName()
+ "->" + propertyType.getSimpleName()
+ " is not found"));
}
}
} else {
LoggerManager.log(new XWTException("Convertor "
+ value.getClass().getSimpleName() + "->"
+ propertyType.getSimpleName()
+ " is not found"));
}
}