/** * {@inheritDoc} * <p> * Converts an instance of the {@code attribute} to a string literal representation. * * @param value the value of the attribute * @param attribute the attribute to instantiate * * @return the string literal representation of the value, or {@code null} if the {@code value} is {@code null} * * @see #revert(Object, EAttribute) * @see EcoreUtil#convertToString(EDataType, Object) */ @Override public Object convert(@Nullable String value, EAttribute attribute) { if (isNull(value)) { return null; } final EDataType dataType = attribute.getEAttributeType(); if (!(dataType instanceof EEnum) && Primitives.isPrimitiveOrString(dataType.getInstanceClass())) { return EcoreUtil.createFromString(dataType, value); } if (FeatureMapUtil.isFeatureMapEntry(dataType)) { throw new UnsupportedOperationException("FeatureMaps are not supported yet: Use standard EMF to import your model"); } return value; }
if (FeatureMapUtil.isFeatureMapEntry(dataType)) { throw new UnsupportedOperationException("FeatureMaps are not supported yet: Use standard EMF to import your model");
if (eType != null && FeatureMapUtil.isFeatureMapEntry(eType))
if (eType != null && FeatureMapUtil.isFeatureMapEntry(eType))
/** * {@inheritDoc} * <p> * Converts an instance of the {@code attribute} to a string literal representation. * * @param value the value of the attribute * @param attribute the attribute to instantiate * * @return the string literal representation of the value, or {@code null} if the {@code value} is {@code null} * * @see #revert(Object, EAttribute) * @see EcoreUtil#convertToString(EDataType, Object) */ @Override public Object convert(@Nullable Object value, EAttribute attribute) { if (isNull(value)) { return null; } final EDataType dataType = attribute.getEAttributeType(); if (!(dataType instanceof EEnum) && Primitives.isPrimitiveOrString(dataType.getInstanceClass())) { return value; } if (FeatureMapUtil.isFeatureMapEntry(dataType)) { return featureMapConverter.convert((FeatureMap.Entry) value, attribute); } return EcoreUtil.convertToString(dataType, value); }
if (FeatureMapUtil.isFeatureMapEntry(dataType)) { return featureMapConverter.revert(strValue, attribute);
eAttributeType == null || eAttributeType.isSerializable() || FeatureMapUtil.isFeatureMapEntry(eAttributeType); if (!result && diagnostics != null)
eAttributeType == null || eAttributeType.isSerializable() || FeatureMapUtil.isFeatureMapEntry(eAttributeType); if (!result && diagnostics != null)