public TemplateContextGenerator(GeneratorConfig generatorConfig,
     TypeRegistry typeRegistry,
     TypeToJavaConverter typeConverter,
     string defaultNamespace)
 {
     this.generatorConfig = generatorConfig;
     this.typeRegistry = typeRegistry;
     this.defaultNamespace = defaultNamespace;
     this.typeConverter = typeConverter;
 }
 public DocumentContext(Uri tripUri,
     string _namespace, GeneratorConfig generatorConfig,
     TypeRegistry typeRegistry)
 {
     Document = IdlParser.BuildDocument(tripUri);
     this.tripUri = tripUri;
     Namespace = _namespace;
     this.generatorConfig = generatorConfig;
     TypeRegistry = typeRegistry;
     TypeConverter = new TypeToJavaConverter(typeRegistry, _namespace, JavaPackage);
 }
Esempio n. 3
0
        public Generator(GeneratorConfig generatorConfig)
        {
            if (!TEMPLATES.ContainsKey(generatorConfig.CodeFlavor))
            {
                throw new ArgumentException(string.Format("Templating type {0} is unknown!", generatorConfig.CodeFlavor));
            }
            this.generatorConfig = generatorConfig;

            this.outputFolder = generatorConfig.OutputFolder;
            if (outputFolder != null && !outputFolder.Exists)
            {
                outputFolder.Create();
            }

            LOG.Debug(string.Format("Writing source files into {0} using {1} ...", outputFolder, generatorConfig.CodeFlavor));

            this.templateLoader = new TemplateLoader(TEMPLATES[generatorConfig.CodeFlavor]);
        }