}
}
public static MetaType convertPropertyDefinitionToMetaType(
PropertyDefinition propDef) {
MetaType memberMetaType;
if (propDef instanceof PropertyDefinitionSimple) {
PropertySimpleType propSimpleType = ((PropertyDefinitionSimple) propDef)
.getType();
memberMetaType = convertPropertySimpleTypeToSimpleMetaType(propSimpleType);
} else if (propDef instanceof PropertyDefinitionList) {
// TODO (very low priority, since lists of lists are not going to be
// at all common)
memberMetaType = null;
} else if (propDef instanceof PropertyDefinitionMap) {
Map<String, PropertyDefinition> memberPropDefs = ((PropertyDefinitionMap) propDef)
.getPropertyDefinitions();
if (memberPropDefs.isEmpty())
throw new IllegalStateException(
"PropertyDefinitionMap doesn't contain any member PropertyDefinitions."); //$NON-NLS-1$
// NOTE: We assume member prop defs are all of the same type, since
// for MapCompositeMetaTypes, they have to be.
PropertyDefinition mapMemberPropDef = memberPropDefs.values()
.iterator().next();
MetaType mapMemberMetaType = convertPropertyDefinitionToMetaType(mapMemberPropDef);
memberMetaType = new MapCompositeMetaType(mapMemberMetaType);
} else {
throw new IllegalStateException(
"List member PropertyDefinition has unknown type: " //$NON-NLS-1$
+ propDef.getClass().getName());