public static HadoopJarStepConfigUnmarshaller GetInstance() { if (instance == null) { instance = new HadoopJarStepConfigUnmarshaller(); } return(instance); }
public StepConfig Unmarshall(UnmarshallerContext context) { StepConfig stepConfig = new StepConfig(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Name", targetDepth)) { stepConfig.Name = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ActionOnFailure", targetDepth)) { stepConfig.ActionOnFailure = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("HadoopJarStep", targetDepth)) { stepConfig.HadoopJarStep = HadoopJarStepConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(stepConfig); } } return(stepConfig); }