Class DefaultEAttributeValueConverterImpl

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        DefaultEAttributeValueConverterImpl()
      Default no value constructor (will use the DEFAULT_LIST_SEPARATOR and DEFAULT_PRIORITY for this converter).
      protected DefaultEAttributeValueConverterImpl​(java.lang.String listSeparator, double priority)
      Constructor which allows to override the list separator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object convertToLiteral​(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object instance)
      Convert model value instance to string literal.
      java.lang.Object convertToModelValue​(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String literal)
      Convert string literal to model value instance.
      protected java.lang.Object fromString​(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.String literal)
      Convert literal to Object.
      double isApplicable​(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value, EStructuralFeatureValueConverter.Direction direction)
      Check whether this converter instance is applicable for the given feature.
      protected java.lang.Object toString​(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object instance)
      Basic conversion from model to string literal.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_LIST_SEPARATOR

        public static final java.lang.String DEFAULT_LIST_SEPARATOR
        Default list separator token.
        See Also:
        Constant Field Values
      • DEFAULT_PRIORITY

        public static final double DEFAULT_PRIORITY
        The default priority for this converter implementation. Make sure your converter has a higher priority.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultEAttributeValueConverterImpl

        public DefaultEAttributeValueConverterImpl()
        Default no value constructor (will use the DEFAULT_LIST_SEPARATOR and DEFAULT_PRIORITY for this converter).
      • DefaultEAttributeValueConverterImpl

        protected DefaultEAttributeValueConverterImpl​(java.lang.String listSeparator,
                                                      double priority)
        Constructor which allows to override the list separator.
        Parameters:
        listSeparator - the separator token to split lists (i.e. "|")
        priority - the priority for this converter
    • Method Detail

      • isApplicable

        public double isApplicable​(org.eclipse.emf.ecore.EObject eObject,
                                   org.eclipse.emf.ecore.EStructuralFeature feature,
                                   java.lang.Object value,
                                   EStructuralFeatureValueConverter.Direction direction)
        Description copied from interface: EStructuralFeatureValueConverter
        Check whether this converter instance is applicable for the given feature.
        Specified by:
        isApplicable in interface EStructuralFeatureValueConverter
        Parameters:
        eObject - (optional)
        feature - the target feature
        value - the value
        direction - the direction
        Returns:
        rank of converter (higher value means higher priority)
      • convertToModelValue

        public java.lang.Object convertToModelValue​(org.eclipse.emf.ecore.EObject eObject,
                                                    org.eclipse.emf.ecore.EStructuralFeature feature,
                                                    java.lang.String literal)
        Description copied from interface: EStructuralFeatureValueConverter
        Convert string literal to model value instance.
        Specified by:
        convertToModelValue in interface EStructuralFeatureValueConverter
        Parameters:
        eObject - (optional, only required for EReferences)
        feature - the target feature
        literal - the string literal
        Returns:
        converted value
      • convertToLiteral

        public java.lang.Object convertToLiteral​(org.eclipse.emf.ecore.EObject eObject,
                                                 org.eclipse.emf.ecore.EStructuralFeature feature,
                                                 java.lang.Object instance)
        Description copied from interface: EStructuralFeatureValueConverter
        Convert model value instance to string literal.
        Specified by:
        convertToLiteral in interface EStructuralFeatureValueConverter
        Parameters:
        eObject - (optional)
        feature - the source feature
        instance - the source value object
        Returns:
        converted value (commonly a string literal)
      • fromString

        protected java.lang.Object fromString​(org.eclipse.emf.ecore.EStructuralFeature feature,
                                              java.lang.String literal)
        Convert literal to Object.
        Parameters:
        feature - target feature
        literal - to convert
        Returns:
        converted object
      • toString

        protected java.lang.Object toString​(org.eclipse.emf.ecore.EStructuralFeature feature,
                                            java.lang.Object instance)
        Basic conversion from model to string literal.
        Parameters:
        feature - the feauter
        instance - the model value
        Returns:
        the string value