public static KeyValueUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new KeyValueUnmarshaller();
            }

            return(instance);
        }
        public HadoopJarStepConfig Unmarshall(UnmarshallerContext context)
        {
            HadoopJarStepConfig hadoopJarStepConfig = new HadoopJarStepConfig();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Properties/member", targetDepth))
                    {
                        hadoopJarStepConfig.Properties.Add(KeyValueUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("Jar", targetDepth))
                    {
                        hadoopJarStepConfig.Jar = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("MainClass", targetDepth))
                    {
                        hadoopJarStepConfig.MainClass = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Args/member", targetDepth))
                    {
                        hadoopJarStepConfig.Args.Add(StringUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(hadoopJarStepConfig);
                }
            }

            return(hadoopJarStepConfig);
        }