-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFieldDefinition.java
59 lines (50 loc) · 1.25 KB
/
FieldDefinition.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package nl.rug.jbi.jsm.bcel;
import org.apache.bcel.classfile.Field;
/**
* Represents a field member of the class inspected in the current scope.
*
* @author David van Leusen
* @since 2014-05-28
*/
public class FieldDefinition {
private final Field field;
public FieldDefinition(final Field field) {
this.field = field;
}
/**
* @return Name of this field.
*/
public String getName() {
return this.field.getName();
}
/**
* @return String representing the type of this field.
*/
public String getType() {
return BCELTools.type2className(this.field.getType());
}
/**
* @return Whether this field has the 'public' modifier.
*/
public boolean isPublic() {
return this.field.isPublic();
}
/**
* @return Whether this field has the 'protected' modifier.
*/
public boolean isProtected() {
return this.field.isProtected();
}
/**
* @return Whether this field has the 'private' modifier.
*/
public boolean isPrivate() {
return this.field.isPrivate();
}
/**
* @return Whether this field has the 'static' modifier.
*/
public boolean isStatic() {
return this.field.isStatic();
}
}