1 33 34 package net.percederberg.grammatica.code.csharp; 35 36 import java.io.PrintWriter ; 37 38 import net.percederberg.grammatica.code.CodeElement; 39 import net.percederberg.grammatica.code.CodeStyle; 40 41 47 public class CSharpClass extends CSharpType { 48 49 52 public static final int PUBLIC = CSharpModifier.PUBLIC; 53 54 58 public static final int PROTECTED_INTERNAL = 59 CSharpModifier.PROTECTED_INTERNAL; 60 61 65 public static final int PROTECTED = CSharpModifier.PROTECTED; 66 67 70 public static final int INTERNAL = CSharpModifier.INTERNAL; 71 72 76 public static final int PRIVATE = CSharpModifier.PRIVATE; 77 78 81 public static final int ABSTRACT = CSharpModifier.ABSTRACT; 82 83 86 public static final int SEALED = CSharpModifier.SEALED; 87 88 92 public static final int NEW = CSharpModifier.NEW; 93 94 100 public CSharpClass(String name) { 101 this(PUBLIC, name); 102 } 103 104 111 public CSharpClass(int modifiers, String name) { 112 this(modifiers, name, ""); 113 } 114 115 123 public CSharpClass(int modifiers, String name, String extendsClass) { 124 super(modifiers, name, extendsClass); 125 } 126 127 136 public CSharpClass(int modifiers, String name, String [] extendClasses) { 137 super(modifiers, name, extendClasses); 138 } 139 140 148 public int category() { 149 return 10; 150 } 151 152 157 public void addClass(CSharpClass member) { 158 addElement(member); 159 } 160 161 166 public void addEnumeration(CSharpEnumeration member) { 167 addElement(member); 168 } 169 170 175 public void addConstructor(CSharpConstructor member) { 176 member.setCSharpClass(this); 177 addElement(member); 178 } 179 180 185 public void addMethod(CSharpMethod member) { 186 addElement(member); 187 } 188 189 196 public void print(PrintWriter out, CodeStyle style, int indent) { 197 print(out, style, indent, "class"); 198 } 199 200 208 protected void printSeparator(PrintWriter out, 209 CodeStyle style, 210 CodeElement prev, 211 CodeElement next) { 212 213 if (next == null) { 214 } else { 216 out.println(); 217 } 218 } 219 } 220 | Popular Tags |