Example #1
0
        public IJavaData Convert(JavaObject @object)
        {
            string code    = @object.SelectValue <string>("language");
            string country = @object.SelectValue <string>("country");

            if (!string.IsNullOrEmpty(country))
            {
                code += "-" + country;
            }
            return(new JavaValue(CultureInfo.GetCultureInfo(code)));
        }
        public IJavaData Convert(JavaObject @object)
        {
            double value = @object.SelectValue <double>("intVal");
            int    scale = @object.SelectValue <int>("scale");

            for (int i = 0; i < scale; ++i)
            {
                value /= 10.0;
            }
            return(new JavaValue(value));
        }
Example #3
0
        public IJavaData Convert(JavaObject @object)
        {
            byte[] data  = @object.SelectValue <byte[]>("[0]");
            long   milli = BitConverter.ToInt64(data.Reverse().ToArray(), 0);

            return(new JavaValue(unix + TimeSpan.FromMilliseconds(milli)));
        }
        public IJavaData Convert(JavaObject @object)
        {
            byte[] bytes  = @object.SelectValues <byte>("magnitude").ToArray();
            long   signum = @object.SelectValue <long>("signum");

            if (bytes.Length == 0)
            {
                return(new JavaValue(signum));
            }

            foreach (byte field in bytes)
            {
                signum = (signum << 8) | field;
            }
            return(new JavaValue(signum));
        }
Example #5
0
 public IJavaData Convert(JavaObject @object)
 {
     return(new JavaValue(@object.SelectValue <object>("value")));
 }