private void generatePropertyDescriptor(final ClassAnnotation cad, final ClassDescription classDescription,
final boolean metatype, final String propertyName, final String propertyDescriptorName, PropertyType propertyType, String label, String description, boolean isArray) {
final PropertyDescription pd = new PropertyDescription(cad);
pd.setName(propertyDescriptorName);
pd.setLabel(label);
pd.setDescription(description);
pd.setType(propertyType);
if(isArray) {
final String[] values = (String[]) cad.getValue(propertyName);
pd.setMultiValue(values);
pd.setUnbounded(PropertyUnbounded.ARRAY);
pd.setCardinality(Integer.MAX_VALUE);
} else {
final Object propertyVal = cad.getValue(propertyName);
String pdValue = (propertyVal instanceof String) ? (String) propertyVal :
propertyVal!=null ? propertyVal.toString() : null;
pd.setValue(pdValue);
pd.setUnbounded(PropertyUnbounded.DEFAULT);
}
if (!metatype) {
pd.setPrivate(true);
}
classDescription.add(pd);
}