Пример #1
0
        /*
         *  Description:  This method will try to read data from a given 'IFormatReader'
         *                  and return the root 'IEmployee' object for the data.
         *  Inputs:
         *      N/A
         *  Output:
         *      IEmployee - root 'IEmployee' object for employee hierarchy data
         */
        public IEmployee Read()
        {
            // Call the 'Read()' method from the referenced 'IFormatReader' object
            var employeeData = _reader.Read();

            // Ensure that the result of the 'IFormatReader.Read()' action was not null
            if (employeeData == null)
            {
                throw new EmptyEmployeeDataException("ERROR :: Employee Data is Empty!");
            }

            // Return the root 'IEmployee' object
            return(employeeData);
        }
Пример #2
0
        public SerializableStructure Deserialize(string input, IFormatReader formatter)
        {
            Dump dump = formatter.Read(input);

            return dump == null ? null : CreateFromDump(dump);
        }
Пример #3
0
        public IDumper Deserialize(string input, IFormatReader formatter)
        {
            Dump dump = formatter.Read(input);

            return(dump == null ? null : CreateFromDump(dump));
        }