public static String getGetAccessor(final GenFeature genFeature, final ResourceSet resourceSet) { final GenClass genClass = genFeature.getGenClass(); boolean _isMapEntry = genClass.isMapEntry(); if (_isMapEntry) { GenFeature _mapEntryKeyFeature = genClass.getMapEntryKeyFeature(); boolean _equals = Objects.equal(genFeature, _mapEntryKeyFeature); if (_equals) { return "getKey"; } GenFeature _mapEntryValueFeature = genClass.getMapEntryValueFeature(); boolean _equals_1 = Objects.equal(genFeature, _mapEntryValueFeature); if (_equals_1) { return "getValue"; } } return genFeature.getGetAccessor(); } }
public String getImportedMapKeyType(GenClass context) { EGenericType eGenericType = getEcoreTypedElement().getEGenericType(); if (eGenericType.getETypeArguments().size() == 2) { return getTypeArgument(context,eGenericType.getETypeArguments().get(0), true, false); } else { GenClass genClass = getMapEntryTypeGenClass(); return genClass == null ? null : genClass.getMapEntryKeyFeature().getImportedType(context); } }
public String getImportedMapKeyType(GenClass context) { EGenericType eGenericType = getEcoreTypedElement().getEGenericType(); if (eGenericType.getETypeArguments().size() == 2) { return getTypeArgument(context,eGenericType.getETypeArguments().get(0), true, false); } else { GenClass genClass = getMapEntryTypeGenClass(); return genClass == null ? null : genClass.getMapEntryKeyFeature().getImportedType(context); } }
protected String getEffectiveMapType(GenClass context, GenClass genClass) { String mapType = getEffectiveMapType(); if (getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50) { String keyType = genClass.getMapEntryKeyFeature().getType(context); String valueType = genClass.getMapEntryValueFeature().getType(context); mapType += "<" + keyType + ", " + valueType + ">"; } return mapType; }
protected String getEffectiveMapType(GenClass context, GenClass genClass) { String mapType = getEffectiveMapType(); if (getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50) { String keyType = genClass.getMapEntryKeyFeature().getType(context); String valueType = genClass.getMapEntryValueFeature().getType(context); mapType += "<" + keyType + ", " + valueType + ">"; } return mapType; }
if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_86); stringBuffer.append(genClass.getSafeUncapName()); stringBuffer.append(genModel.getNonNLS(2)); } else { if (genClass.getMapEntryKeyFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_89); stringBuffer.append(genClass.getSafeUncapName());
if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_86); stringBuffer.append(genClass.getSafeUncapName()); stringBuffer.append(genModel.getNonNLS(2)); } else { if (genClass.getMapEntryKeyFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_89); stringBuffer.append(genClass.getSafeUncapName()); if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_117); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")); stringBuffer.append(genModel.getNonNLS(2)); } else { if (genClass.getMapEntryKeyFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_89); stringBuffer.append(genClass.getSafeUncapName());
protected String getEffectiveMapEntryType(GenClass context, GenClass genClass) { String mapType = getEffectiveMapEntryType(); if (getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50) { GenFeature mapEntryKeyFeature = genClass.getMapEntryKeyFeature(); GenFeature mapEntryValueFeature = genClass.getMapEntryValueFeature(); if (mapEntryKeyFeature.getTypeGenClassifier() != genClass && mapEntryValueFeature.getTypeGenClassifier() != genClass) { String keyType = mapEntryKeyFeature.getType(context); String valueType = mapEntryValueFeature.getType(context); mapType += "<" + keyType + ", " + valueType + ">"; } } return mapType; }
stringBuffer.append(TEXT_218); if (genFeature.isListType()) { if (genFeature.isMapType()) { GenFeature keyFeature = genFeature.getMapEntryTypeGenClass().getMapEntryKeyFeature(); GenFeature valueFeature = genFeature.getMapEntryTypeGenClass().getMapEntryValueFeature(); stringBuffer.append(TEXT_219); if (keyFeature.isListType()) {
stringBuffer.append(TEXT_189); if (genFeature.isListType() && genFeature.getEcoreFeature().getEGenericType().getETypeParameter() == null) { if (genFeature.isMapType()) { GenFeature keyFeature = genFeature.getMapEntryTypeGenClass().getMapEntryKeyFeature(); GenFeature valueFeature = genFeature.getMapEntryTypeGenClass().getMapEntryValueFeature(); stringBuffer.append(TEXT_190); if (keyFeature.isListType()) {
if (isImplementation && genClass.isMapEntry()) { GenFeature keyFeature = genClass.getMapEntryKeyFeature(); GenFeature valueFeature = genClass.getMapEntryValueFeature(); String objectType = genModel.getImportedName("java.lang.Object"); String keyType = isJDK50 ? keyFeature.getObjectType(genClass) : objectType;
if (isImplementation && genClass.isMapEntry()) { GenFeature keyFeature = genClass.getMapEntryKeyFeature(); GenFeature valueFeature = genClass.getMapEntryValueFeature(); String objectType = genModel.getImportedName("java.lang.Object"); String keyType = genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50 ? keyFeature.getObjectType(genClass) : objectType;
protected String getMapModelInfo(boolean qualified, boolean includeFeatures) { GenClass mapGenClass = getMapEntryTypeGenClass(); if (mapGenClass != null) { StringBuffer result = new StringBuffer(); GenFeature keyFeature = mapGenClass.getMapEntryKeyFeature(); GenFeature valueFeature = mapGenClass.getMapEntryValueFeature(); String mapType = mapGenClass.getGenPackage().getInterfacePackageName() + '.' + mapGenClass.getEcoreClass().getName(); boolean useGenerics = getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50; if (useGenerics) { mapType += '<' + getEcoreType(keyFeature.getEcoreFeature().getEGenericType()) + ", " + getEcoreType(valueFeature.getEcoreFeature().getEGenericType()) + '>'; } appendModelSetting(result, qualified, "mapType", mapType); if (includeFeatures && !useGenerics) { appendModelSetting(result, qualified, "keyType", getType(getContext(), keyFeature.getEcoreFeature().getEType(), false)); appendModelSetting(result, qualified, "valueType", getType(getContext(), valueFeature.getEcoreFeature().getEType(), false)); } return result.toString(); } return null; }
protected String getMapModelInfo(boolean qualified, boolean includeFeatures) { GenClass mapGenClass = getMapEntryTypeGenClass(); if (mapGenClass != null) { StringBuffer result = new StringBuffer(); GenFeature keyFeature = mapGenClass.getMapEntryKeyFeature(); GenFeature valueFeature = mapGenClass.getMapEntryValueFeature(); String mapType = mapGenClass.getGenPackage().getInterfacePackageName() + '.' + mapGenClass.getEcoreClass().getName(); boolean useGenerics = getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50; if (useGenerics) { mapType += '<' + getEcoreType(keyFeature.getEcoreFeature().getEGenericType()) + ", " + getEcoreType(valueFeature.getEcoreFeature().getEGenericType()) + '>'; } appendModelSetting(result, qualified, "mapType", mapType); if (includeFeatures && !useGenerics) { appendModelSetting(result, qualified, "keyType", getType(getContext(), keyFeature.getEcoreFeature().getEType(), false)); appendModelSetting(result, qualified, "valueType", getType(getContext(), valueFeature.getEcoreFeature().getEType(), false)); } return result.toString(); } return null; }