ReadMapEnd() public abstract method

Reads the end of a list.
public abstract ReadMapEnd ( ) : void
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Reads string valued object
        /// </summary>
        /// <param name="abstractHessianInput">HessianInput Instance</param>
        /// <returns>Read string valued object</returns>
        public override object ReadMap(AbstractHessianInput abstractHessianInput)
        {
            String strInitValue = null;

            while (!abstractHessianInput.IsEnd())
            {
                string strKey   = abstractHessianInput.ReadString();
                string strValue = abstractHessianInput.ReadString();

                if (strKey.Equals("value"))
                {
                    strInitValue = strValue;
                }
            }

            abstractHessianInput.ReadMapEnd();

            if (strInitValue == null)
            {
                throw new IOException(m_type.FullName + " expects name.");
            }

            try
            {
                return(m_constructor.Invoke(new Object[] { strInitValue }));
            }
            catch (Exception e)
            {
                throw new IOException(e.ToString());
            }
        }
Ejemplo n.º 2
0
        public override object ReadMap(AbstractHessianInput abstractHessianInput)
        {
            String strInitValue = null;

            while (!abstractHessianInput.IsEnd())
            {
                string strKey = abstractHessianInput.ReadString();
                string strValue = abstractHessianInput.ReadString();

                if (strKey.Equals("value"))
                    strInitValue = strValue;
            }

            abstractHessianInput.ReadMapEnd();

            if (strInitValue == null)
                throw new IOException("No value found for decimal.");

            return Decimal.Parse(strInitValue);
        }
Ejemplo n.º 3
0
        public override object ReadMap(AbstractHessianInput abstractHessianInput)
        {
            string enumName = null;

            while (!abstractHessianInput.IsEnd())
            {
                string key = abstractHessianInput.ReadString();
                if (key.Equals("name"))
                {
                    enumName = abstractHessianInput.ReadString();
                }
                else
                {
                    abstractHessianInput.ReadObject(); // ignore
                }
            }
            abstractHessianInput.ReadMapEnd();

            object result = Enum.Parse(e_type, enumName, false);

            abstractHessianInput.AddRef(result);
            return(result);
        }
Ejemplo n.º 4
0
        public override object ReadMap(AbstractHessianInput abstractHessianInput)
        {
            String strInitValue = null;

            while (!abstractHessianInput.IsEnd())
            {
                string strKey   = abstractHessianInput.ReadString();
                string strValue = abstractHessianInput.ReadString();

                if (strKey.Equals("value"))
                {
                    strInitValue = strValue;
                }
            }

            abstractHessianInput.ReadMapEnd();

            if (strInitValue == null)
            {
                throw new IOException("No value found for decimal.");
            }

            return(Decimal.Parse(strInitValue));
        }
Ejemplo n.º 5
0
        public override object ReadMap(AbstractHessianInput abstractHessianInput)
        {
            string enumName = null;
            while (!abstractHessianInput.IsEnd())
            {
                string key = abstractHessianInput.ReadString();
                if (key.Equals("name"))
                    enumName = abstractHessianInput.ReadString();
                else
                    abstractHessianInput.ReadObject(); // ignore
            }
            abstractHessianInput.ReadMapEnd();

            object result = Enum.Parse(e_type, enumName, false);
            abstractHessianInput.AddRef(result);
            return result;
        }
        /// <summary>
        /// Reads string valued object
        /// </summary>
        /// <param name="abstractHessianInput">HessianInput Instance</param>
        /// <returns>Read string valued object</returns>
        public override object ReadMap(AbstractHessianInput abstractHessianInput)
        {
            String strInitValue = null;

            while (!abstractHessianInput.IsEnd())
            {
                string strKey = abstractHessianInput.ReadString();
                string strValue = abstractHessianInput.ReadString();

                if (strKey.Equals("value"))
                    strInitValue = strValue;
            }

            abstractHessianInput.ReadMapEnd();

            if (strInitValue == null)
                throw new IOException(m_type.FullName + " expects name.");

            try
            {
                return m_constructor.Invoke(new Object[]{strInitValue});
            }
            catch (Exception e)
            {
                throw new IOException(e.ToString());
            }
        }