private static void BuildClass(JsonRpcServiceClassBuilder builder, Type type)
        {
            //
            // Build via attributes.
            //

            object[] attributes = type.GetCustomAttributes(typeof(IServiceClassReflector), true);
            foreach (IServiceClassReflector reflector in attributes)
                reflector.Build(builder, type);
            
            //
            // Fault in the type name if still without name.
            //

            if (builder.Name.Length == 0)
                builder.Name = type.Name;

            //
            // Get all the public instance methods on the type and create a
            // filtered table of those to expose from the service.
            //
            
            MethodInfo[] publicMethods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance);

            foreach (MethodInfo method in publicMethods)
            {
                if (ShouldBuild(method))
                    BuildMethod(builder.DefineMethod(), method);
            }
        }
 public void Init()
 {
     _classBuilder = new JsonRpcServiceClassBuilder();
     _builder = _classBuilder.DefineMethod();
 }