Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions core/src/main/java/org/kohsuke/stapler/lang/FieldRef.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public boolean keep(FieldRef m) {
*/
public abstract String getQualifiedName();

/**
* Returns the {@code Class} object representing the class or interface
* that declares the executable represented by this object.
* @see java.lang.reflect.Member#getDeclaringClass()
*/
public abstract Class<?> getDeclaringClass();

/**
* Gets the signature for this for use in lists
*
Expand Down Expand Up @@ -107,6 +114,11 @@ public String getSignature() {
return String.join(" ", prefix, f.getDeclaringClass().getName(), getName());
}

@Override
public Class<?> getDeclaringClass() {
return f.getDeclaringClass();
}

@Override
public String getQualifiedName() {
return f.getDeclaringClass().getName()+"."+getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ protected FieldRef getBase() {
return f;
}

@Override
public Class<?> getDeclaringClass() {
return f.getDeclaringClass();
}

@Override
public String getSignature() {
return f.getQualifiedName(); // doesn't really matter
Expand Down