use of eu.esdihumboldt.hale.common.schema.model.impl.PropertyTypeOverrideProperty in project hale by halestudio.
the class CustomTypeContentHelper method replaceTypeForProperty.
private static void replaceTypeForProperty(PropertyDefinition propDef, DefinitionGroup propParent, TypeDefinition newPropertyType) {
PropertyDefinition newProperty;
if (propDef instanceof PropertyTypeOverrideProperty) {
newProperty = new PropertyTypeOverrideProperty(((PropertyTypeOverrideProperty) propDef).getDecoratedProperty(), newPropertyType);
} else {
newProperty = new PropertyTypeOverrideProperty(propDef, newPropertyType);
}
if (propParent instanceof DefaultTypeDefinition) {
DefaultTypeDefinition type = (DefaultTypeDefinition) propParent;
type.overrideChild(newProperty);
} else // else if (propParent instanceof DefaultGroupPropertyDefinition) {
// // TODO
// }
{
log.error("Could not update custom content property because of unsupported parent definition group");
}
}
Aggregations