1 33 34 package net.percederberg.grammatica.code.java; 35 36 import java.io.PrintWriter ; 37 38 import net.percederberg.grammatica.code.CodeStyle; 39 40 46 public class JavaInterface extends JavaType { 47 48 51 public static final int PUBLIC = JavaModifier.PUBLIC; 52 53 57 public static final int PROTECTED = JavaModifier.PROTECTED; 58 59 62 public static final int PACKAGE_LOCAL = JavaModifier.PACKAGE_LOCAL; 63 64 68 public static final int PRIVATE = JavaModifier.PRIVATE; 69 70 74 public static final int STATIC = JavaModifier.STATIC; 75 76 79 public static final int STRICTFP = JavaModifier.STRICTFP; 80 81 87 public JavaInterface(String name) { 88 this(PUBLIC, name); 89 } 90 91 98 public JavaInterface(int modifiers, String name) { 99 this(modifiers, name, ""); 100 } 101 102 110 public JavaInterface(int modifiers, String name, String extendType) { 111 super(modifiers, name, extendType, ""); 112 } 113 114 119 public void addMethod(JavaMethod member) { 120 member.setPrintCode(false); 121 addElement(member); 122 } 123 124 129 public void addVariable(JavaVariable member) { 130 addElement(member); 131 } 132 133 141 public int category() { 142 return 9; 143 } 144 145 152 public void print(PrintWriter out, CodeStyle style, int indent) { 153 super.print(out, style, indent, "interface"); 154 } 155 } 156 | Popular Tags |