@Override public BeanDescriptor getBeanDescriptor() { return this.delegate.getBeanDescriptor(); }
@Override public BeanDescriptor getBeanDescriptor() { return this.delegate.getBeanDescriptor(); }
Class<?> getBeanClass() { return this.beanInfo.getBeanDescriptor().getBeanClass(); }
Class<?> getBeanClass() { return this.beanInfo.getBeanDescriptor().getBeanClass(); }
/** Default human-presentable name of the service type. * In the default implementation, taken from the bean descriptor. * @return initial value of the human-presentable name * @see java.beans.FeatureDescriptor#getDisplayName */ protected String displayName() { try { return Introspector.getBeanInfo(getClass()).getBeanDescriptor().getDisplayName(); } catch (Exception e) { // Catching IntrospectionException, but also maybe NullPointerException...? Logger.getLogger(ServiceType.class.getName()).log(Level.WARNING, null, e); return getClass().getName(); } }
/** Finds help context for a generic object. Right now checks * for HelpCtx.Provider and handles java.awt.Component in a * special way compatible with JavaHelp. * Also {@link BeanDescriptor}'s are checked for a string-valued attribute * <code>helpID</code>, as per the JavaHelp specification (but no help sets * will be loaded). * * @param instance to search help for * @return the help for the object or <code>HelpCtx.DEFAULT_HELP</code> if HelpCtx cannot be found * * @since 4.3 */ public static HelpCtx findHelp(Object instance) { if (instance instanceof java.awt.Component) { return findHelp((java.awt.Component) instance); } if (instance instanceof HelpCtx.Provider) { return ((HelpCtx.Provider) instance).getHelpCtx(); } try { BeanDescriptor d = Introspector.getBeanInfo(instance.getClass()).getBeanDescriptor(); String v = (String) d.getValue("helpID"); // NOI18N if (v != null) { return new HelpCtx(v); } } catch (IntrospectionException e) { err.log(Level.FINE, "findHelp on {0}: {1}", new Object[]{instance, e}); } return HelpCtx.DEFAULT_HELP; }
List<AttachedObjectTarget> targets = (List<AttachedObjectTarget>) info.getBeanDescriptor() .getValue(AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
public BeanDescriptor getBeanDescriptor() { return delegate.getBeanDescriptor(); }
BeanDescriptor componentDescriptor = componentBeanInfo.getBeanDescriptor(); if (null == componentDescriptor) { throw new TagException(tag, "Composite component BeanInfo does not have BeanDescriptor");
@Override public boolean hasCustomizer() { // true if we have already computed beanInfo and it has customizer class return beanInfo.getBeanDescriptor().getCustomizerClass() != null; }
/** Default human-presentable name of the service type. * In the default implementation, taken from the bean descriptor. * @return initial value of the human-presentable name * @see java.beans.FeatureDescriptor#getDisplayName */ protected String displayName() { try { return Introspector.getBeanInfo(getClass()).getBeanDescriptor().getDisplayName(); } catch (Exception e) { // Catching IntrospectionException, but also maybe NullPointerException...? Logger.getLogger(ServiceType.class.getName()).log(Level.WARNING, null, e); return getClass().getName(); } }
Class getBeanClass() { return this.beanInfo.getBeanDescriptor().getBeanClass(); }
/** * Returns name of the bean. */ private String getNameForBean() { if (nameGetter != null) { try { String name = (String) nameGetter.invoke(bean); return (name != null) ? name : ""; // NOI18N } catch (Exception ex) { NodeOp.warning(ex); } } BeanDescriptor descriptor = beanInfo.getBeanDescriptor(); return descriptor.getDisplayName(); }
/** Finds help context for a generic object. Right now checks * for HelpCtx.Provider and handles java.awt.Component in a * special way compatible with JavaHelp. * Also {@link BeanDescriptor}'s are checked for a string-valued attribute * <code>helpID</code>, as per the JavaHelp specification (but no help sets * will be loaded). * * @param instance to search help for * @return the help for the object or <code>HelpCtx.DEFAULT_HELP</code> if HelpCtx cannot be found * * @since 4.3 */ public static HelpCtx findHelp(Object instance) { if (instance instanceof java.awt.Component) { return findHelp((java.awt.Component) instance); } if (instance instanceof HelpCtx.Provider) { return ((HelpCtx.Provider) instance).getHelpCtx(); } try { BeanDescriptor d = Introspector.getBeanInfo(instance.getClass()).getBeanDescriptor(); String v = (String) d.getValue("helpID"); // NOI18N if (v != null) { return new HelpCtx(v); } } catch (IntrospectionException e) { err.log(Level.FINE, "findHelp on {0}: {1}", new Object[]{instance, e}); } return HelpCtx.DEFAULT_HELP; }
setNameSilently(getNameForBean()); BeanDescriptor descriptor = beanInfo.getBeanDescriptor(); String sd = descriptor.getShortDescription(); for (Enumeration e = beanInfo.getBeanDescriptor().attributeNames(); e.hasMoreElements();) { String aname = (String) e.nextElement(); setValue(aname, beanInfo.getBeanDescriptor().getValue(aname));
BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor(); Class type = beanDescriptor.getBeanClass();
@Override public java.awt.Component getCustomizer() { Class clazz = beanInfo.getBeanDescriptor().getCustomizerClass();
public static void installFor(Class<? extends Enum> enumClass) { try { BeanInfo info = Introspector.getBeanInfo( enumClass ); info.getBeanDescriptor().setValue( "persistenceDelegate", INSTANCE ); } catch( IntrospectionException exception ) { throw new RuntimeException("Unable to persist enumerated type "+enumClass, exception); } }
/** * Return whether a bean described by a BeanInto is a faces component bean (UIComponent) * * @param beanInfo * @return */ public static final boolean isFacesBean(BeanInfo beanInfo) { return UIComponent.class.isAssignableFrom(beanInfo.getBeanDescriptor().getBeanClass()); }
/** Prepare node properties based on the bean, storing them into the current property sheet. * Called when the bean info is ready. * This implementation always creates a set for standard properties * and may create a set for expert ones if there are any. * @see #computeProperties * @param bean bean to compute properties for * @param info information about the bean */ protected void createProperties(T bean, BeanInfo info) { Descriptor d = computeProperties(bean, info); Sheet sets = getSheet(); Sheet.Set pset = Sheet.createPropertiesSet(); pset.put(d.property); BeanDescriptor bd = info.getBeanDescriptor(); if ((bd != null) && (bd.getValue("propertiesHelpID") != null)) { // NOI18N pset.setValue("helpID", bd.getValue("propertiesHelpID")); // NOI18N } sets.put(pset); if (d.expert.length != 0) { Sheet.Set eset = Sheet.createExpertSet(); eset.put(d.expert); if ((bd != null) && (bd.getValue("expertHelpID") != null)) { // NOI18N eset.setValue("helpID", bd.getValue("expertHelpID")); // NOI18N } sets.put(eset); } }