"PickList Document Type for Validation", InMemoryDocumentTypeDefinition.getRootDocumentType());
Map<String, PropertyDefinition<?>> propertyDefinitions = new HashMap<String, PropertyDefinition<?>>();
// create a String property definition
PropertyStringDefinitionImpl propDef = PropertyCreationHelper.createStringDefinition(PICK_LIST_PROP_DEF,
"Sample PickList (choice) Property");
List<Choice<String>> choiceList = new ArrayList<Choice<String>>();
ChoiceImpl<String> elem = new ChoiceImpl<String>();
elem.setValue(Collections.singletonList("red"));
elem.setDisplayName("Red");
choiceList.add(elem);
elem = new ChoiceImpl<String>();
elem.setValue(Collections.singletonList("green"));
elem.setDisplayName("Green");
choiceList.add(elem);
elem = new ChoiceImpl<String>();
elem.setValue(Collections.singletonList("blue"));
elem.setDisplayName("Blue");
choiceList.add(elem);
elem = new ChoiceImpl<String>();
elem.setValue(Collections.singletonList("black"));
elem.setDisplayName("Black");
choiceList.add(elem);
propDef.setChoices(choiceList);
propDef.setDefaultValue(Collections.singletonList("blue"));
propDef.setCardinality(cardinality);
propertyDefinitions.put(propDef.getId(), propDef);
cmisType.setPropertyDefinitions(propertyDefinitions);
return cmisType;
}