@Override public Object convertToCDO(EClassifier eType, Object value) { return EcoreUtil.convertToString((EDataType)eType, value); } };
public String getValueLabel(EDataType eDataType, Object value) { return EcoreUtil.convertToString(eDataType, value); }
public String getValueLabel(EDataType eDataType, Object value) { return EcoreUtil.convertToString(eDataType, value); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public void setValue(Object newValue) { setRawValue(EcoreUtil.convertToString(instanceType, newValue)); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public void setValue(Object newValue) { setRawValue(EcoreUtil.convertToString(instanceType, newValue)); }
/** * If non-null, the value is converted to a string, using the type of its attribute and the appropriate factory. */ @Override public String getText(Object object) { return value != null ? EcoreUtil.convertToString(((EAttribute)feature).getEAttributeType(), value) : "null"; }
/** * Converts an instance of the {@code attribute} to a string literal representation. * * @param attribute the attribute to instantiate * @param value a value of the attribute * * @return the string literal representation of the value * * @see EcoreUtil#convertToString(EDataType, Object) */ protected Object serializeToProperty(EAttribute attribute, Object value) { return isNull(value) ? null : EcoreUtil.convertToString(attribute.getEAttributeType(), value); } }
/** * Returns the single value of the attribute's {@link ETypedElement#getEType() type} for the modeled object converted to a literal representation as used in {@link EAnnotation#getDetails() detail entry}. * <p> * This implementation simple uses {@link EcoreUtil#convertToString(EDataType, Object)}. * </p> * @param eObject the modeled object. * @param eAttribute an attribute feature of that object. * @param value the value of the feature's type to converted to a literal representation. * @return a value of the feature's type converted to a literal representation. * @see #convertPropertyValueToLiteral(EObject, EStructuralFeature, Object) */ protected String convertPropertyAttributeValueToLiteralItem(EObject eObject, EAttribute eAttribute, Object value) { return EcoreUtil.convertToString(eAttribute.getEAttributeType(), value); }
/** * @since 2.1.0 */ public static String getValueLabel(EDataType eDataType, Object value, Map<Object, Object> context) { if (context != null) { SubstitutionLabelProvider substitutionlabelProvider = (SubstitutionLabelProvider)context.get(SubstitutionLabelProvider.class); if (substitutionlabelProvider != null) { return substitutionlabelProvider.getValueLabel(eDataType, value); } } return EcoreUtil.convertToString(eDataType, value); }
/** * @since 2.1.0 */ public static String getValueLabel(EDataType eDataType, Object value, Map<Object, Object> context) { if (context != null) { SubstitutionLabelProvider substitutionlabelProvider = (SubstitutionLabelProvider)context.get(SubstitutionLabelProvider.class); if (substitutionlabelProvider != null) { return substitutionlabelProvider.getValueLabel(eDataType, value); } } return EcoreUtil.convertToString(eDataType, value); }
@Override public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { EAttribute feature = (EAttribute) EMFContext.getFeature(serializers); if (feature != null) { gen.writeString(EcoreUtil.convertToString(feature.getEAttributeType(), value)); } else { gen.writeNull(); } }
@Override public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { EAttribute feature = (EAttribute) EMFContext.getFeature(serializers); if (feature != null) { gen.writeString(EcoreUtil.convertToString(feature.getEAttributeType(), value)); } else { gen.writeNull(); } }
@Override protected Object validate(int index, Object object) { EDataType type = (EDataType)getFeature().getEType(); return EcoreUtil.convertToString(type, object); } };
@Override protected Object validate(int index, Object object) { EDataType type = (EDataType)getFeature().getEType(); return EcoreUtil.convertToString(type, object); } };
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public String getDataValue() { if (valueString == null) { EStructuralFeature feature = getFeature(); if (feature instanceof EAttribute) { EDataType type = (EDataType)feature.getEType(); valueString = EcoreUtil.convertToString(type, value); } } return valueString; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public String getDataValue() { if (valueString == null) { EStructuralFeature feature = getFeature(); if (feature instanceof EAttribute) { EDataType type = (EDataType)feature.getEType(); valueString = EcoreUtil.convertToString(type, value); } } return valueString; }
/** * Returns the value of the object's ID attribute as a String. * If the object has no ID attribute or the ID attribute is not set, it returns <code>null</code>. * @param eObject the object in question. * @return the value of the object's ID attribute as a String. * @see org.eclipse.emf.ecore.EAttribute#isID * @see org.eclipse.emf.ecore.EClass#getEIDAttribute * @see #setID(EObject, String) */ public static String getID(EObject eObject) { EClass eClass = eObject.eClass(); EAttribute eIDAttribute = eClass.getEIDAttribute(); return eIDAttribute == null || !eObject.eIsSet(eIDAttribute) ? null : convertToString( eIDAttribute.getEAttributeType(), eObject.eGet(eIDAttribute)); }
/** * Returns the value of the object's ID attribute as a String. * If the object has no ID attribute or the ID attribute is not set, it returns <code>null</code>. * @param eObject the object in question. * @return the value of the object's ID attribute as a String. * @see org.eclipse.emf.ecore.EAttribute#isID * @see org.eclipse.emf.ecore.EClass#getEIDAttribute * @see #setID(EObject, String) */ public static String getID(EObject eObject) { EClass eClass = eObject.eClass(); EAttribute eIDAttribute = eClass.getEIDAttribute(); return eIDAttribute == null || !eObject.eIsSet(eIDAttribute) ? null : convertToString( eIDAttribute.getEAttributeType(), eObject.eGet(eIDAttribute)); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public String getDataValue() { if (valueString == null) { EStructuralFeature feature = getFeature(); if (feature instanceof EAttribute && !feature.isMany()) { EDataType type = (EDataType)feature.getEType(); valueString = EcoreUtil.convertToString(type, value); } } return valueString; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public String getDataValue() { if (valueString == null) { EStructuralFeature feature = getFeature(); if (feature instanceof EAttribute && !feature.isMany()) { EDataType type = (EDataType)feature.getEType(); valueString = EcoreUtil.convertToString(type, value); } } return valueString; }