public override object GetJsonFragment(object @object)
        {
            var item = JsonFieldGetterHelperSchema.GetJsonIndexedProp(@object, _field.PropertyName, Index);
            if (item == null) {
                return null;
            }

            return InnerGetter.GetJsonFragment(item);
        }
예제 #2
0
        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);
        }
예제 #4
0
        public override object GetJsonFragment(object @object)
        {
            var value = JsonFieldGetterHelperSchema.GetJsonSimpleProp(_field, @object);
            if (value == null) {
                return null;
            }

            return InnerGetter.GetJsonFragment(value);
        }
예제 #5
0
        public override bool GetJsonExists(object @object)
        {
            var item = JsonFieldGetterHelperProvided.GetJsonProvidedIndexedProp(@object, field, Index);
            if (item == null) {
                return false;
            }

            return InnerGetter.GetJsonExists(item);
        }
예제 #6
0
        public override bool GetJsonExists(object @object)
        {
            var value = JsonFieldGetterHelperSchema.GetJsonSimpleProp(_field, @object);
            if (value == null) {
                return false;
            }

            return InnerGetter.GetJsonExists(value);
        }
예제 #7
0
        public override object GetJsonFragment(object @object)
        {
            var value = JsonFieldGetterHelperProvided.GetJsonProvidedSimpleProp(@object, field);
            if (value == null) {
                return null;
            }

            return InnerGetter.GetJsonFragment(value);
        }
예제 #8
0
        public override bool GetJsonExists(object @object)
        {
            var value = JsonFieldGetterHelperProvided.GetJsonProvidedSimpleProp(@object, field);
            if (value == null) {
                return false;
            }

            return InnerGetter.GetJsonExists(value);
        }
예제 #9
0
        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));
        }