protected void handleEStructuralFeatures(List<EStructuralFeature> structuralFeatures, Set<EClassifier> visited) { if (structuralFeatures != null) { for (EStructuralFeature structuralFeature : structuralFeatures) { handleEGenericType(structuralFeature.getEGenericType(), visited); } } }
protected void handleEStructuralFeatures(List<EStructuralFeature> structuralFeatures, Set<EPackage> visitedPackages, Set<Object> visited) { if (structuralFeatures != null) { for (EStructuralFeature structuralFeature : structuralFeatures) { handleEGenericType(structuralFeature.getEGenericType(), visitedPackages, visited); } } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public EGenericType getFeatureType(EStructuralFeature feature) { int featureID = getFeatureID(feature); if (featureID != -1) { if (eAllStructuralFeatureTypes == null) { EGenericType[] result = new EGenericType[eAllStructuralFeaturesData.length]; for (int i = 0; i < eAllStructuralFeaturesData.length; ++i) { EGenericType eGenericType = eAllStructuralFeaturesData[i].getEGenericType(); if (eGenericType != null) { result[i] = EcoreUtil.getReifiedType(this, eGenericType); } } eAllStructuralFeatureTypes = result; } return eAllStructuralFeatureTypes[featureID]; } else { return feature.getEGenericType(); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public EGenericType getFeatureType(EStructuralFeature feature) { int featureID = getFeatureID(feature); if (featureID != -1) { if (eAllStructuralFeatureTypes == null) { EGenericType[] result = new EGenericType[eAllStructuralFeaturesData.length]; for (int i = 0; i < eAllStructuralFeaturesData.length; ++i) { EGenericType eGenericType = eAllStructuralFeaturesData[i].getEGenericType(); if (eGenericType != null) { result[i] = EcoreUtil.getReifiedType(this, eGenericType); } } eAllStructuralFeatureTypes = result; } return eAllStructuralFeatureTypes[featureID]; } else { return feature.getEGenericType(); } }
public boolean shouldSaveType(EClass objectType, EClass featureType, EStructuralFeature feature) { return objectType != featureType && (featureType.isAbstract() || feature.getEGenericType().getETypeParameter() != null); } }
public boolean shouldSaveType(EClass objectType, EClass featureType, EStructuralFeature feature) { return objectType != featureType && (featureType.isAbstract() || feature.getEGenericType().getETypeParameter() != null); } }
private void appendReifiedFeatureInverseOverride(StringBuffer sb, GenFeature genFeature) { GenClass sourceGenClass = genFeature.getGenClass(); EGenericType eGenericType = genFeature.getEcoreFeature().getEGenericType(); if (isReifiedType(sourceGenClass, eGenericType)) { sb.append(" { private static final long serialVersionUID = 1L; @Override public "); sb.append(getGenModel().getImportedName("java.lang.Class")); sb.append("<?> getInverseFeatureClass() { return "); sb.append(getTypeArgument(sourceGenClass, eGenericType, true, true)); sb.append(".class; } }"); } }
EGenericType eType = owner == null ? feature.getEGenericType() : owner.eClass().getFeatureType(feature); for (Object replacement : collection)
if (saveTypeInfo ? xmlTypeInfo.shouldSaveType(eClass, expectedType, f) : eClass != expectedType && (expectedType.isAbstract() || f.getEGenericType().getETypeParameter() != null))
if (saveTypeInfo ? xmlTypeInfo.shouldSaveType(eClass, expectedType, f) : eClass != expectedType && (expectedType.isAbstract() || f.getEGenericType().getETypeParameter() != null))
public boolean hasEDefault() { return getEcoreFeature() instanceof EAttribute && (getEffectiveComplianceLevel().getValue() < GenJDKLevel.JDK50 || (getEcoreFeature().getEType().getETypeParameters().isEmpty() && getEcoreFeature().getEGenericType().getETypeParameter() == null && getEcoreFeature().getEType().getInstanceTypeName() == getEcoreFeature().getEType().getInstanceClassName())); }
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; }
public boolean hasEDefault() { return getEcoreFeature() instanceof EAttribute && (getEffectiveComplianceLevel().getValue() < GenJDKLevel.JDK50 || (getEcoreFeature().getEType() != null && getEcoreFeature().getEType().getETypeParameters().isEmpty() && getEcoreFeature().getEGenericType().getETypeParameter() == null && getEcoreFeature().getEType().getInstanceTypeName() == getEcoreFeature().getEType().getInstanceClassName())); }
public List<GenFeature> getReifiedGenFeatures() { List<GenFeature> result = new ArrayList<GenFeature>(); if (getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50) { GenClass classExtendsGenClass = getClassExtendsGenClass(); if (classExtendsGenClass != null) { List<GenFeature> inheritedGenFeatures = classExtendsGenClass.getImplementedGenFeatures(); GenModel genModel = getGenModel(); for (GenFeature genFeature : inheritedGenFeatures) { if ((genFeature.isSet() || genFeature.isBasicSet() && !genModel.isReflectiveDelegation() || genFeature.isGet() && genFeature.isListType() && !genModel.isDynamicDelegation() && !genModel.isReflectiveDelegation() && !genFeature.hasSettingDelegate() && !genFeature.isVolatile()) && isReifiedType(classExtendsGenClass, genFeature.getEcoreFeature().getEGenericType())) { result.add(genFeature); } } } } return result; }
protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType())); handleImport(xsdSchema, xsdSimpleTypeDefinition); xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition); String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdAttributeDeclaration.setLexicalValue(defaultValue); } xsdSchema.getContents().add(xsdAttributeDeclaration); map(xsdAttributeDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdAttributeDeclaration, eStructuralFeature); return xsdAttributeDeclaration; }
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); EClassifier eType = eStructuralFeature.getEType(); XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eType)); handleImport(xsdSchema, xsdTypeDefinition); xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition); if (isWrapperType(eType)) { xsdElementDeclaration.setNillable(true); } String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdElementDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdElementDeclaration.setLexicalValue(defaultValue); } xsdSchema.getContents().add(xsdElementDeclaration); map(xsdElementDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdElementDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdElementDeclaration, eStructuralFeature); return xsdElementDeclaration; }
protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType())); handleImport(xsdSchema, xsdSimpleTypeDefinition); xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition); String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdAttributeDeclaration.setLexicalValue(transformDefaultValue(xsdAttributeDeclaration.getTypeDefinition(), defaultValue)); } xsdSchema.getContents().add(xsdAttributeDeclaration); map(xsdAttributeDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdAttributeDeclaration, eStructuralFeature); return xsdAttributeDeclaration; }
createEcoreAnnotation(xsdSimpleTypeDefinition, referenceType == null ? "type" : "reference", getGenericType(xsdSchema, eStructuralFeature.getEGenericType()));
createEcoreAnnotation(xsdSimpleTypeDefinition, referenceType == null ? "type" : "reference", getGenericType(xsdSchema, eStructuralFeature.getEGenericType()));