Example #1
0
        public IEnumerable <string> GenerateStubPropertyMethods(string sourceNamespace, GenClass genClass)
        {
            yield return(DtGenUtil.GenStubPrivateMember(_prop, string.Format("NullableEnum<{0}>", _prop.PropType.GenericTypeArguments[0].Name), string.Format("new NullableEnum<{0}>()", _prop.PropType.GenericTypeArguments[0].Name)));

            yield return(DtGenUtil.GenStubGetMethod(_prop, string.Format("NullableEnum<{0}>", _prop.PropType.GenericTypeArguments[0].Name)));

            yield return(DtGenUtil.GenStubSetMethod(_prop, string.Format("NullableEnum<{0}>", _prop.PropType.GenericTypeArguments[0].Name), genClass));
        }
Example #2
0
        public IEnumerable <string> GenerateStubPropertyMethods(string sourceNamespace, GenClass genClass)
        {
            yield return(DtGenUtil.GenStubPrivateMember(_prop, "int", "0"));

            yield return(DtGenUtil.GenStubGetMethod(_prop, "int"));

            yield return(DtGenUtil.GenStubSetMethod(_prop, "int", genClass));
        }
Example #3
0
        public IEnumerable <string> GenerateStubPropertyMethods(string sourceNamespace, GenClass genClass)
        {
            yield return(DtGenUtil.GenStubPrivateMember(_prop, string.Format("List<{0}>", _prop.PropType.GenericTypeArguments[0].Name), string.Format("new ArrayList<{0}>()", _prop.PropType.GenericTypeArguments[0].Name)));

            yield return(DtGenUtil.GenStubGetMethod(_prop, string.Format("List<{0}>", _prop.PropType.GenericTypeArguments[0].Name)));

            //yield return DtGenUtil.GenStubSetMethod(_prop, string.Format("ArrayList<{0}>", _prop.PropType.GenericTypeArguments[0].Name), genClass);
            yield return(string.Format("\t@Override public I{2} set{0}(Iterable<{1}> val) {{ this._{0} = JavaOnlyUtils.toList(val); return this; }}", _prop.Name, _prop.PropType.GenericTypeArguments[0].Name, genClass.Name));
        }
Example #4
0
        public IEnumerable <string> GenerateStubPropertyMethods(string sourceNamespace, GenClass genClass)
        {
            var val = Convert.ChangeType(Enum.GetValues(_prop.PropType).GetValue(0), Enum.GetUnderlyingType(Enum.GetValues(_prop.PropType).GetValue(0).GetType()));

            yield return(DtGenUtil.GenStubPrivateMember(_prop, _prop.PropType.Name, string.Format("{0}.fromValue({1})", _prop.PropType.Name, val)));

            yield return(DtGenUtil.GenStubGetMethod(_prop, _prop.PropType.Name));

            yield return(DtGenUtil.GenStubSetMethod(_prop, _prop.PropType.Name, genClass));
        }
Example #5
0
        public IEnumerable <string> GenerateStubPropertyMethods(string sourceNamespace, GenClass genClass)
        {
            yield return(DtGenUtil.GenStubPrivateMember(_prop, "Stub" + _prop.PropType.Name, "null"));

            yield return(DtGenUtil.GenStubGetMethod(_prop, "Stub" + _prop.PropType.Name));



            if (_prop.CanWrite)
            {
                yield return
                    (string.Format(
                         "\t@Override public I{1} set{0}(I{2} val) {{ this._{0} = (Stub{2}) val; return this; }}",
                         _prop.Name, genClass.Name, _prop.PropType.Name));
            }
        }
Example #6
0
        public IEnumerable <string> GenerateStubPropertyMethods(string sourceNamespace, GenClass genClass)
        {
            yield return(DtGenUtil.GenStubPrivateMember(_prop, "StubJsArrayNumber", "new StubJsArrayNumber()"));

            yield return(DtGenUtil.GenStubGetMethod(_prop, "StubJsArrayNumber"));


            if (_prop.CanWrite)
            {
                yield return
                    (string.Format(
                         "\t@Override public I{1} set{0}(IJsArrayNumber val) {{ this._{0} = (StubJsArrayNumber)val; return this; }}",
                         _prop.Name, genClass.Name));

                yield return
                    (string.Format(
                         "\t@Override public I{1} set{0}(Iterable<Double> list) {{ _{0}.setLength(0); for(double i : list) {{ _{0}.push(i); }} return this;  }}",
                         _prop.Name, genClass.Name));
            }
        }
Example #7
0
        public IEnumerable <string> GenerateStubPropertyMethods(string sourceNamespace, GenClass genClass)
        {
            yield return(DtGenUtil.GenStubPrivateMember(_prop, string.Format("StubJsArray<I{0}>", _prop.PropType.GenericTypeArguments[0].Name), string.Format("new StubJsArray<I{0}>()", _prop.PropType.GenericTypeArguments[0].Name)));

            yield return(DtGenUtil.GenStubGetMethod(_prop, string.Format("StubJsArray<I{0}>", _prop.PropType.GenericTypeArguments[0].Name)));

            //yield return DtGenUtil.GenStubSetMethod(_prop, string.Format("StubJsArray<I{0}>", _prop.PropType.GenericTypeArguments[0].Name), genClass);



            if (_prop.CanWrite)
            {
                yield return
                    (string.Format(
                         "\t@Override public I{1} set{0}(IJsArray<I{2}> val) {{ this._{0} = (StubJsArray<I{2}>)val; return this; }}",
                         _prop.Name, genClass.Name, _prop.PropType.GenericTypeArguments[0].Name));


                yield return
                    (string.Format(
                         "\t@Override public I{1} set{0}(Iterable<I{2}> list) {{ _{0}.setLength(0); for(I{2} i : list) {{ _{0}.push(i); }} return this;  }}",
                         _prop.Name, genClass.Name, _prop.PropType.GenericTypeArguments[0].Name));
            }
        }