import com.javaworld.JavaBeans.XMLBeans.*; import java.beans.*; /** * BeanInfo for a Player bean. */ public class PlayerBeanInfo extends XMLSimpleBeanInfo { /** * PlayerBeanInfo constructor comment. */ public PlayerBeanInfo() { super(); } /** * Return the property descriptors for this bean. * This method leaves out grade point average, so it doesn't * show up as a property. * @return PropertyDescriptor[] - The list of property descriptors for this type. */ public PropertyDescriptor[] getPropertyDescriptors() { PropertyDescriptor[] pd = null; try { pd = new PropertyDescriptor[] { new PropertyDescriptor ("Name", Player.class), new PropertyDescriptor("Stats", Player.class, "getStats", "setStats"), new PropertyDescriptor("Number", Player.class), new PropertyDescriptor("HighSchool", Player.class), new PropertyDescriptor("Grades", Player.class) }; } catch (Exception exc) { // If introspection fails, that's just too bad. // Must be compatible with superclass signature (API design flaw) System.err.println("PlayerBeanInfo.getPropertyDescriptors(): " + exc.toString()); } return pd; } }