Naming a BeanInfo Class
The naming of a BeanInfo
class uses a design pattern of its own. The name of the class is a
concatenation of the class name for the Bean with the string
BeanInfo. So if you have a Bean class named
Xyz, its BeanInfo class must be named
XyzBeanInfo. Normally, the BeanInfo class belongs
to the same package as the Bean class it describes, but this is not a
firm requirement. When a BeanInfo class is being located, the package
path for the associated Bean class is searched first; so for Bean
Package.Xyz, the class
Package.XyzBeanInfo is looked for first. If this
class is not found, the XyzBeanInfo class is
searched for in the packages specified by the BeanInfo package search
path. This search path can be accessed using the
getBeanInfoSearchPath() and
setBeanInfoSearchPath() methods of the
java.beans.Instrospector class.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access