1 18 19 package org.objectweb.jac.ide; 20 21 import org.objectweb.jac.util.Strings; 22 23 24 27 public abstract class Member extends TypedElement implements Visibility { 28 29 Class parent; 30 31 35 public Class getParent() { 36 return parent; 37 } 38 39 43 public void setParent(Class v) { 44 this.parent = v; 45 } 46 47 public abstract String getPrototype(); 48 49 50 boolean isStatic = false; 51 52 public boolean isStatic() { 53 return isStatic; 54 } 55 56 public void setStatic(boolean isStatic) { 57 this.isStatic = isStatic; 58 } 59 60 67 public String getModifiers() { 68 String modifiers = ""; 69 switch(visibility) { 70 case PUBLIC: modifiers = "public"; break; 71 case PROTECTED: modifiers = "protected"; break; 72 case PRIVATE: modifiers = "private"; break; 73 } 74 if (isStatic) { 75 modifiers += " static"; 76 } 77 return modifiers; 78 } 79 80 public String getFullName() { 81 return parent.getFullName()+"."+getName(); 82 } 83 84 public String getGenerationName() { 85 return Strings.toUSAscii(getName()); 86 } 87 88 public String getGenerationFullName() { 89 return Strings.toUSAscii(getFullName()); 90 } 91 92 public Project getProject() { 93 if (parent!=null) 94 return parent.getProject(); 95 else 96 return null; 97 } 98 99 int visibility = PUBLIC; 100 public int getVisibility() { 101 return visibility; 102 } 103 public void setVisibility(int newVisibility) { 104 this.visibility = newVisibility; 105 } 106 107 } 108 | Popular Tags |