/// <summary> /// Compile unit /// </summary> private string GenerateNamespace() { var sb = new StringBuilder(); var swJavaBuffer = new StringWriter(sb); ICodeGenerator codeGenerator = new JavaCodeGenerator(); var cop = new CodeGeneratorOptions(); var unit = new CodeCompileUnit(); var nameSpace = new CodeNamespace(type.JVMNamespaceExt); unit.Namespaces.Add(nameSpace); Generate(nameSpace); codeGenerator.GenerateCodeFromCompileUnit(unit, swJavaBuffer, cop); swJavaBuffer.Close(); sb.Replace("This code was generated by a tool.", "This code was generated by jni4net. See http://jni4net.sourceforge.net/ "); return(sb.ToString()); }
/// <summary> /// Compile unit /// </summary> private string GenerateNamespace() { var sb = new StringBuilder(); var swJavaBuffer = new StringWriter(sb); ICodeGenerator codeGenerator = new JavaCodeGenerator(); var cop = new CodeGeneratorOptions(); var unit = new CodeCompileUnit(); var nameSpace = new CodeNamespace(type.JVMNamespaceExt); unit.Namespaces.Add(nameSpace); Generate(nameSpace); codeGenerator.GenerateCodeFromCompileUnit(unit, swJavaBuffer, cop); swJavaBuffer.Close(); sb.Replace("This code was generated by a tool.", "This code was generated by jni4net. See http://jni4net.sourceforge.net/ "); return sb.ToString(); }