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;
16 public final static int EXTENDS = 8;
17 public final static int IMPLEMENTS = 9;
19 private String fIdentifier;
23 public PHPIdentifier(String identifier, int type) {
25 fIdentifier = identifier;
31 * @see java.lang.Object#equals(java.lang.Object)
33 public boolean equals(Object obj) {
34 if (!(obj instanceof PHPIdentifier)) {
37 return ((PHPIdentifier) obj).fType == fType && ((PHPIdentifier) obj).fIdentifier.equals(fIdentifier);
40 public String getIdentifier() {
44 public int getType() {
48 public boolean isClass() {
49 return fType == CLASS;
52 public boolean isFunction() {
53 return fType == FUNCTION;
56 public boolean isVariable() {
57 return fType == VARIABLE;
60 public boolean isMethod() {
61 return fType == METHOD;
64 public boolean isDefine() {
65 return fType == DEFINE;
68 public boolean isGlobalVariable() {
69 return fType == GLOBAL_VARIABLE;
72 public boolean isConstructor() {
73 return fType == CONSTRUCTOR;
76 public void setIdentifier(String fIdentifier) {
77 this.fIdentifier = fIdentifier;
80 public void setType(int fType) {
87 * @see java.lang.Object#toString()
89 public String toString() {
94 return "constructor - ";
99 case GLOBAL_VARIABLE :
100 return "global variable - ";
104 return "variable - ";