Esempio n. 1
0
        public static void PrintInterface(Interface iface, string root, List <string> imports)
        {
            string packageDirectory = Path.Combine(root, JavaConventionHelper.packageConvention(iface.Namespace.Name));

            Directory.CreateDirectory(packageDirectory);
            using (StreamWriter writer = new StreamWriter(Path.Combine(packageDirectory, iface.Name + ".java")))
            {
                InterfaceGenerator javaGen = new InterfaceGenerator();
                writer.WriteLine(javaGen.Generate(iface, imports));
            }
        }
Esempio n. 2
0
        public static void PrintException(Struct ex, string root)
        {
            string packageDirectory   = Path.Combine(root, JavaConventionHelper.packageConvention(ex.Namespace.Name));
            string exceptionDirectory = Path.Combine(packageDirectory, "exceptions");

            Directory.CreateDirectory(exceptionDirectory);
            using (StreamWriter writer = new StreamWriter(Path.Combine(exceptionDirectory, ex.Name + ".java")))
            {
                ExceptionGenerator javaGen = new ExceptionGenerator();
                writer.WriteLine(javaGen.Generate(ex));
            }
        }
Esempio n. 3
0
        public static void PrintEnum(Symbols.Enum en, string root)
        {
            string packageDirectory = Path.Combine(root, JavaConventionHelper.packageConvention(en.Namespace.Name));
            string enumDirectory    = Path.Combine(packageDirectory, "enums");

            Directory.CreateDirectory(enumDirectory);
            using (StreamWriter writer = new StreamWriter(Path.Combine(enumDirectory, en.Name + ".java")))
            {
                EnumGenerator javaGen = new EnumGenerator();
                writer.WriteLine(javaGen.Generate(en));
            }
        }