public override object GetJsonFragment(object @object) { var item = JsonFieldGetterHelperSchema.GetJsonIndexedProp(@object, _field.PropertyName, Index); if (item == null) { return null; } return InnerGetter.GetJsonFragment(item); }
public override object GetJsonFragment(object @object) { var item = JsonFieldGetterHelperProvided.GetJsonProvidedIndexedProp(@object, field, Index); if (item == null) { return null; } return InnerGetter.GetJsonFragment(item); }
public override bool GetJsonExists(object @object) { var item = JsonFieldGetterHelperSchema.GetJsonIndexedProp(@object, _field.PropertyName, Index); if (item == null) { return false; } return InnerGetter.GetJsonExists(item); }
public override object GetJsonFragment(object @object) { var value = JsonFieldGetterHelperSchema.GetJsonSimpleProp(_field, @object); if (value == null) { return null; } return InnerGetter.GetJsonFragment(value); }
public override bool GetJsonExists(object @object) { var item = JsonFieldGetterHelperProvided.GetJsonProvidedIndexedProp(@object, field, Index); if (item == null) { return false; } return InnerGetter.GetJsonExists(item); }
public override bool GetJsonExists(object @object) { var value = JsonFieldGetterHelperSchema.GetJsonSimpleProp(_field, @object); if (value == null) { return false; } return InnerGetter.GetJsonExists(value); }
public override object GetJsonFragment(object @object) { var value = JsonFieldGetterHelperProvided.GetJsonProvidedSimpleProp(@object, field); if (value == null) { return null; } return InnerGetter.GetJsonFragment(value); }
public override bool GetJsonExists(object @object) { var value = JsonFieldGetterHelperProvided.GetJsonProvidedSimpleProp(@object, field); if (value == null) { return false; } return InnerGetter.GetJsonExists(value); }
public CodegenExpression UnderlyingExistsCodegen( CodegenExpression underlyingExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { CodegenMethod method = codegenMethodScope.MakeChild(typeof(bool), this.GetType(), codegenClassScope) .AddParam(UnderlyingClassName, "und"); method.Block .DeclareVar(FieldType, "inner", ExprDotName(Ref("und"), FieldName)) .IfRefNull("inner") .BlockReturn(ConstantFalse()) .MethodReturn(InnerGetter.UnderlyingExistsCodegen(Ref("inner"), method, codegenClassScope)); return(LocalMethod(method, underlyingExpression)); }
public CodegenExpression UnderlyingGetCodegen( CodegenExpression underlyingExpression, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { CodegenMethod method = codegenMethodScope.MakeChild(typeof(object), this.GetType(), codegenClassScope) .AddParam(UnderlyingClassName, "und"); method.Block .DeclareVar(FieldType, "inner", ExprDotName(Ref("und"), FieldName)) .IfRefNullReturnNull("inner") .IfCondition(Relational(Constant(Index), GE, ExprDotName(Ref("inner"), "Length"))) .BlockReturn(ConstantNull()) .MethodReturn(InnerGetter.UnderlyingGetCodegen(ArrayAtIndex(Ref("inner"), Constant(Index)), method, codegenClassScope)); return(LocalMethod(method, underlyingExpression)); }