1 33 34 package net.percederberg.grammatica.code.csharp; 35 36 import java.io.PrintWriter ; 37 import net.percederberg.grammatica.code.CodeElementContainer; 38 import net.percederberg.grammatica.code.CodeStyle; 39 40 46 public class CSharpNamespace extends CodeElementContainer { 47 48 51 private String name; 52 53 58 public CSharpNamespace(String name) { 59 this.name = name; 60 } 61 62 70 public int category() { 71 return 11; 72 } 73 74 79 public void addClass(CSharpClass c) { 80 addElement(c); 81 } 82 83 88 public void addEnumeration(CSharpEnumeration e) { 89 addElement(e); 90 } 91 92 99 public void print(PrintWriter out, CodeStyle style, int indent) { 100 String indentStr = style.getIndent(indent); 101 102 out.println(indentStr + "namespace " + name + " {"); 103 out.println(); 104 printContents(out, style, indent + 1); 105 out.println(indentStr + "}"); 106 } 107 } 108 | Popular Tags |