/** * Converts choices. */ @SuppressWarnings({ "rawtypes" }) private static List<Choice<BigInteger>> convertChoicesInteger(final Object choices) { if (!(choices instanceof List)) { return null; } List<Choice<BigInteger>> result = new ArrayList<Choice<BigInteger>>(); for (Object obj : (List) choices) { Map<String, Object> choiceMap = getMap(obj); if (choiceMap != null) { ChoiceImpl<BigInteger> choice = new ChoiceImpl<BigInteger>(); choice.setDisplayName(getString(choiceMap, JSON_PROPERTY_TYPE_CHOICE_DISPLAYNAME)); Object choiceValue = choiceMap.get(JSON_PROPERTY_TYPE_CHOICE_VALUE); List<BigInteger> values = new ArrayList<BigInteger>(); if (choiceValue instanceof List) { for (Object value : (List) choiceValue) { values.add((BigInteger) getCMISValue(value, PropertyType.INTEGER)); } } else { values.add((BigInteger) getCMISValue(choiceValue, PropertyType.INTEGER)); } choice.setValue(values); choice.setChoice(convertChoicesInteger(choiceMap.get(JSON_PROPERTY_TYPE_CHOICE_CHOICE))); result.add(choice); } } return result; }
/** * Converts choices. */ @SuppressWarnings({ "rawtypes" }) private static List<Choice<BigInteger>> convertChoicesInteger(final Object choices) { if (!(choices instanceof List)) { return null; } List<Choice<BigInteger>> result = new ArrayList<Choice<BigInteger>>(); for (Object obj : (List) choices) { Map<String, Object> choiceMap = getMap(obj); if (choiceMap != null) { ChoiceImpl<BigInteger> choice = new ChoiceImpl<BigInteger>(); choice.setDisplayName(getString(choiceMap, JSON_PROPERTY_TYPE_CHOICE_DISPLAYNAME)); Object choiceValue = choiceMap.get(JSON_PROPERTY_TYPE_CHOICE_VALUE); List<BigInteger> values = new ArrayList<BigInteger>(); if (choiceValue instanceof List) { for (Object value : (List) choiceValue) { values.add((BigInteger) getCMISValue(value, PropertyType.INTEGER)); } } else { values.add((BigInteger) getCMISValue(choiceValue, PropertyType.INTEGER)); } choice.setValue(values); choice.setChoice(convertChoicesInteger(choiceMap.get(JSON_PROPERTY_TYPE_CHOICE_CHOICE))); result.add(choice); } } return result; }
((PropertyIntegerDefinitionImpl) result).setMaxValue(getInteger(json, JSON_PROPERTY_TYPE_MAX_VALUE)); ((PropertyIntegerDefinitionImpl) result) .setChoices(convertChoicesInteger(json.get(JSON_PROPERTY_TYPE_CHOICE))); break; case DATETIME:
((PropertyIntegerDefinitionImpl) result).setMaxValue(getInteger(json, JSON_PROPERTY_TYPE_MAX_VALUE)); ((PropertyIntegerDefinitionImpl) result) .setChoices(convertChoicesInteger(json.get(JSON_PROPERTY_TYPE_CHOICE))); break; case DATETIME: