| 32 | import java.util.Set; |
| 33 | |
| 34 | public abstract class ClassMember implements Annotated, Serializable { |
| 35 | |
| 36 | protected final JClass declaringClass; |
| 37 | |
| 38 | protected final String name; |
| 39 | |
| 40 | protected final Set<Modifier> modifiers; |
| 41 | |
| 42 | protected final AnnotationHolder annotationHolder; |
| 43 | |
| 44 | protected String signature; |
| 45 | |
| 46 | // TODO: source location |
| 47 | |
| 48 | protected ClassMember(JClass declaringClass, String name, |
| 49 | Set<Modifier> modifiers, |
| 50 | AnnotationHolder annotationHolder) { |
| 51 | this.declaringClass = declaringClass; |
| 52 | this.name = name; |
| 53 | this.modifiers = modifiers; |
| 54 | this.annotationHolder = annotationHolder; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * @return the declaring class of the class member. |
| 59 | */ |
| 60 | public JClass getDeclaringClass() { |
| 61 | return declaringClass; |
| 62 | } |
| 63 | |
| 64 | public String getName() { |
| 65 | return name; |
| 66 | } |
| 67 | |
| 68 | public String getSignature() { |
| 69 | return signature; |
| 70 | } |
| 71 | |
| 72 | public Set<Modifier> getModifiers() { |
| 73 | return modifiers; |
| 74 | } |
| 75 | |
| 76 | public boolean isPublic() { |
| 77 | return Modifier.hasPublic(modifiers); |
| 78 | } |
| 79 | |
| 80 | public boolean isProtected() { |
| 81 | return Modifier.hasProtected(modifiers); |
| 82 | } |
| 83 | |
| 84 | public boolean isPrivate() { |
| 85 | return Modifier.hasPrivate(modifiers); |
| 86 | } |
| 87 | |
| 88 | public boolean isStatic() { |
| 89 | return Modifier.hasStatic(modifiers); |
| 90 | } |
| 91 |
nothing calls this directly
no outgoing calls
no test coverage detected