Please run the following test example:
import java.beans.*;
import javax.swing.SwingContainer;
public class SwingContainerTest {
@SwingContainer(true)
public class Base {
protected int x;
@BeanProperty(description = "TEST", expert = true)
public int getX() { return x; }
public void setX(int v) { x = v; }
}
public class Child extends Base {}
private static void Test(Class<?> c) throws IntrospectionException {
System.out.println("test " + c.getSimpleName() + ":");
BeanInfo i = Introspector.getBeanInfo(c, Object.class);
PropertyDescriptor pds[] = i.getPropertyDescriptors();
for (PropertyDescriptor d: pds) {
System.out.println(d.getShortDescription() +
" property, isExpert = " + d.isExpert());
}
System.out.println("isContainer = " + i.getBeanDescriptor().getValue("isContainer") + "\n");
}
public static void main(String[] args) throws IntrospectionException {
Test(Base.class);
Test(Child.class);
}
}
Output (JDK9 b77, Win 7):
test Base:
TEST property, isExpert = true
isContainer = true
test Child:
TEST property, isExpert = true
isContainer = null
so the property info was inherited, the container's - was not.