java.beans.beancontext
import java.beans.*;
public class BeanContext1 {
public static void main(String[] args) throws IntrospectionException {
Class<?> beanClass = MyBean.class;
BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
BeanContext context = beanInfo.getBeanDescriptor().getBeanContext();
}
}import java.beans.*;
import java.util.Locale;
public class BeanContext2 {
public static void main(String[] args) throws IntrospectionException {
Class<?> beanClass = MyBean.class;
BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
beanInfo.getBeanDescriptor().setBeanContext(new Locale("en", "US"));
}
}