public Collection<Model> getReferenceModels(final PropertyType type) { final ArrayList<Model> models = Lists.<Model>newArrayList(); if ((type instanceof ObjectPropertyType)) { final ObjectPropertyType propertyType = ((ObjectPropertyType) type); Type _type = propertyType.getType(); models.add(_type); } else { if ((type instanceof DictionaryPropertyType)) { final DictionaryPropertyType dictionaryType = ((DictionaryPropertyType) type); PropertyType _keyType = dictionaryType.getKeyType(); Collection<Model> _referenceModels = this.getReferenceModels(_keyType); models.addAll(_referenceModels); PropertyType _valueType = dictionaryType.getValueType(); Collection<Model> _referenceModels_1 = this.getReferenceModels(_valueType); models.addAll(_referenceModels_1); } } return models; } }
public String type(final PropertyType type) { if ((type instanceof PrimitivePropertyType)) { PrimitiveType _type = ((PrimitivePropertyType) type).getType(); return this.toCppPrimitive(_type); } else { if ((type instanceof DictionaryPropertyType)) { PropertyType _keyType = ((DictionaryPropertyType) type).getKeyType(); String _type_1 = this.type(_keyType); String _plus = ("map<" + _type_1); String _plus_1 = (_plus + ","); PropertyType _valueType = ((DictionaryPropertyType) type).getValueType(); String _type_2 = this.type(_valueType); String _plus_2 = (_plus_1 + _type_2); return (_plus_2 + ">"); } else { Type _type_3 = ((ObjectPropertyType) type).getType(); String _namespace = _type_3.getNamespace(); String _replace = _namespace.replace(".", "_"); String _plus_3 = (_replace + "::"); Type _type_4 = ((ObjectPropertyType) type).getType(); String _name = _type_4.getName(); return (_plus_3 + _name); } } }