Ejemplo n.º 1
0
        public static StepDetailUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new StepDetailUnmarshaller();
            }

            return(instance);
        }
Ejemplo n.º 2
0
        public JobFlowDetail Unmarshall(UnmarshallerContext context)
        {
            JobFlowDetail jobFlowDetail = new JobFlowDetail();
            int           originalDepth = context.CurrentDepth;
            int           targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("JobFlowId", targetDepth))
                    {
                        jobFlowDetail.JobFlowId = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

                        continue;
                    }
                    if (context.TestExpression("ExecutionStatusDetail", targetDepth))
                    {
                        jobFlowDetail.ExecutionStatusDetail = JobFlowExecutionStatusDetailUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Instances", targetDepth))
                    {
                        jobFlowDetail.Instances = JobFlowInstancesDetailUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Steps/member", targetDepth))
                    {
                        jobFlowDetail.Steps.Add(StepDetailUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("BootstrapActions/member", targetDepth))
                    {
                        jobFlowDetail.BootstrapActions.Add(BootstrapActionDetailUnmarshaller.GetInstance().Unmarshall(context));

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

            return(jobFlowDetail);
        }