1 package net.sourceforge.phpeclipse.obfuscator;
4 * Object which holds an PHP identifier name (i.e. class, function, variable,...)
7 public class PHPIdentifier {
9 public final static int CLASS = 1;
10 public final static int FUNCTION = 2;
11 public final static int VARIABLE = 3;
12 public final static int METHOD = 4;
13 public final static int DEFINE = 5;
14 public final static int CONSTRUCTOR = 6;
15 public final static int GLOBAL_VARIABLE = 7;
17 private String fIdentifier;
21 public PHPIdentifier(String identifier, int type) {
23 fIdentifier = identifier;
29 * @see java.lang.Object#equals(java.lang.Object)
31 public boolean equals(Object obj) {
32 if (!(obj instanceof PHPIdentifier)) {
35 return ((PHPIdentifier) obj).fType == fType && ((PHPIdentifier) obj).fIdentifier.equals(fIdentifier);
38 public String getIdentifier() {
42 public int getType() {
46 public boolean isClass() {
47 return fType == CLASS;
50 public boolean isFunction() {
51 return fType == FUNCTION;
54 public boolean isVariable() {
55 return fType == VARIABLE;
58 public boolean isMethod() {
59 return fType == METHOD;
62 public boolean isDefine() {
63 return fType == DEFINE;
66 public boolean isGlobalVariable() {
67 return fType == GLOBAL_VARIABLE;
70 public boolean isConstructor() {
71 return fType == CONSTRUCTOR;
74 public void setIdentifier(String fIdentifier) {
75 this.fIdentifier = fIdentifier;
78 public void setType(int fType) {
85 * @see java.lang.Object#toString()
87 public String toString() {
92 return "constructor - ";
97 case GLOBAL_VARIABLE :
98 return "global variable - ";
102 return "variable - ";