use of com.pogeyan.cmis.api.data.common.CmisPropertyBooleanDefinitionImpl in project copper-cms by PogeyanOSS.
the class MTypeObject method getPropertyDefinitions.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public Map<String, PropertyDefinition<?>> getPropertyDefinitions() {
Map<String, PropertyDefinition<?>> map = new LinkedHashMap<String, PropertyDefinition<?>>();
if (propertyDefinition != null) {
Set<Entry<String, MongoPropertyDefinition<?>>> data = propertyDefinition.entrySet();
for (Map.Entry<String, MongoPropertyDefinition<?>> propertiesValues : data) {
String id = propertiesValues.getKey();
PropertyDefinitionImpl<?> valueName = propertiesValues.getValue();
String propertyType = valueName.getPropertyType().toString();
if (propertyType.equalsIgnoreCase("string")) {
CmisPropertyStringDefinitionImpl propertyValue = new CmisPropertyStringDefinitionImpl(valueName);
map.put(id, propertyValue);
} else if (propertyType.equalsIgnoreCase("boolean")) {
CmisPropertyBooleanDefinitionImpl propertyValue = new CmisPropertyBooleanDefinitionImpl(valueName);
map.put(id, propertyValue);
} else if (propertyType.equalsIgnoreCase("id")) {
CmisPropertyIdDefinitionImpl propertyValue = new CmisPropertyIdDefinitionImpl(valueName);
map.put(id, propertyValue);
} else if (propertyType.equalsIgnoreCase("datetime")) {
CmisPropertyDateTimeDefinitionImpl propertyValue = new CmisPropertyDateTimeDefinitionImpl(valueName);
map.put(id, propertyValue);
} else if (propertyType.equalsIgnoreCase("decimal")) {
CmisPropertyDecimalDefinitionImpl propertyValue = new CmisPropertyDecimalDefinitionImpl(valueName);
map.put(id, propertyValue);
} else if (propertyType.equalsIgnoreCase("html")) {
CmisPropertyHtmlDefinitionImpl propertyValue = new CmisPropertyHtmlDefinitionImpl(valueName);
map.put(id, propertyValue);
} else if (propertyType.equalsIgnoreCase("uri")) {
CmisPropertyUriDefinitionImpl propertyValue = new CmisPropertyUriDefinitionImpl(valueName);
map.put(id, propertyValue);
} else if (propertyType.equalsIgnoreCase("integer")) {
CmisPropertyIntegerDefinitionImpl propertyValue = new CmisPropertyIntegerDefinitionImpl(valueName);
map.put(id, propertyValue);
}
}
}
return map;
}
Aggregations