Object valueOrValues ) {
Name propName = names.create(name);
Property prop = null;
if (valueOrValues instanceof Object[]) {
Object[] values = (Object[])valueOrValues;
PropertyType type = propertyTypeOf(values);
prop = propertyFactory.create(propName, type, values);
} else if (valueOrValues == null) {
prop = propertyFactory.create(propName, new Object[] {});
} else {
PropertyType type = PropertyType.discoverType(valueOrValues);
prop = propertyFactory.create(propName, type, valueOrValues);
}
return prop;
}