Class BaseEnumXmlPartReader

    • Constructor Detail

      • BaseEnumXmlPartReader

        public BaseEnumXmlPartReader()
    • Method Detail

      • read

        public void read​(org.eclipse.emf.ecore.EObject context,
                         org.eclipse.emf.ecore.EStructuralFeature feature,
                         IXmlNode node,
                         String attributeName,
                         Version version,
                         IXmlReadErrorCollector errorCollector)
        Description copied from interface: IXmlPartReader
        Read and convert node named attribute content to value in context-feature.
        Parameters:
        context - the context EObject, cannot be null
        feature - the EStructuralFeature, cannot be null
        node - the source IXmlNode, cannot be null
        attributeName - the name of attribute to set as value in model, or null to use text from node
        version - the version of importing 1C:Enterprise XML files, cannot be null
        errorCollector - the IXmlReadErrorCollector to add occurred errors
      • valueFromString

        protected Object valueFromString​(org.eclipse.emf.ecore.EAttribute feature,
                                         String value,
                                         Version version,
                                         IXmlReadErrorCollector errorCollector)
        Convert string value to enum value.

        Tries to get Enum as literal from given string value or from given string value with capital letter

        Parameters:
        feature - the Enum type EAttribute, cannot be null
        value - string text value of readed enum, can be null
        version - the version of importing 1C:Enterprise XML files, cannot be null
        errorCollector - IXmlReadErrorCollector in which will be added error if it occur, cannot be null
        Returns:
        instance of enumerator, never null
        Throws:
        IllegalArgumentException - if the value is not a valid for enumerator in feature type