public StepConfig Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { return(null); } StepConfig stepConfig = new StepConfig(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { 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; } } return(stepConfig); }
public static HadoopJarStepConfigUnmarshaller GetInstance() { if (instance == null) { instance = new HadoopJarStepConfigUnmarshaller(); } return(instance); }
public StepConfig Unmarshall(XmlUnmarshallerContext 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); }
public StepConfig Unmarshall(JsonUnmarshallerContext context) { StepConfig stepConfig = new StepConfig(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if ((context.IsKey) && (context.CurrentDepth == targetDepth)) { context.Read(); context.Read(); 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); }