Java 8 BeanInfo - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 BeanInfo class.

This code example shows how to use the following methods:getBeanDescriptor
		} 
	} 
 
	@Override 
	public String entityName() {
		return _beanInfo.getBeanDescriptor().getBeanClass().getSimpleName();
	} 
	 
	@Override 
	public Class classForAttributeKey(String key) {
		for (PropertyDescriptor descriptor : _beanInfo.getPropertyDescriptors()) {
			if (descriptor.getName().equals(key) && isAttribute(descriptor)) {
				return descriptor.getPropertyType();
			} 
		} 
		return null; 
	} 
 
	protected boolean isAttribute(PropertyDescriptor descriptor) {
		return isAttribute(descriptor.getPropertyType());
5
CodeRank
This code example shows how to use the following methods:getEventSetDescriptors
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public EventSetDescriptor[] getEventSetDescriptors() {
        return rootBeanInfo.getEventSetDescriptors();
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public Image getIcon(int iconKind) {
        return icons[iconKind];
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public MethodDescriptor[] getMethodDescriptors() {
        return rootBeanInfo.getMethodDescriptors();
    } 
 
4
CodeRank
This code example shows how to use the following methods:getBeanDescriptor
            log.error("Can't get beanInfo for " + testBeanClass.getName(), e);
            throw new Error(e.toString()); // Programming error. Don't
                                            // continue. 
        } 
 
        customizerClass = beanInfo.getBeanDescriptor().getCustomizerClass();
 
        // Creation of the customizer and GUI initialization is delayed until 
        // the 
        // first 
        // configure call. We don't need all that just to find out the static 
        // label, menu 
        // categories, etc! 
        initialized = false;
        JMeterUtils.addLocaleChangeListener(this);
    } 
 
    private Customizer createCustomizer() {
        try { 
            return (Customizer) customizerClass.newInstance();
4
CodeRank
This code example shows how to use the following methods:getPropertyDescriptors
	 * (as determined by standard JavaBeans introspection). 
	 * @return the PropertyDescriptors for the wrapped object 
	 */ 
	public PropertyDescriptor[] getPropertyDescriptors()
	{ 
		return this.beanInfo ==null ? null:this.beanInfo.getPropertyDescriptors();
	} 
 
	/** 
	 * Obtain the property descriptor for a specific property 
	 * of the wrapped object. 
	 * @param propertyName the property to obtain the descriptor for 
	 * (may be a nested path, but no indexed/mapped property) 
	 * @return the property descriptor for the specified property 
	 * @throws InvalidPropertyException if there is no such property 
	 */ 
	public PropertyDescriptor getPropertyDescriptor(String propertyName) throws BeansException
	{ 
		PropertyDescriptor[] pds = this.getPropertyDescriptors();
		if(pds == null)
4
CodeRank
This code example shows how to use the following methods:getIcon
	return beanDescriptor;
    } 
 
    public java.awt.Image getIcon(int iconKind) {
	if (targetBeanInfo != null) {
	    return targetBeanInfo.getIcon(iconKind);
	} 
	return super.getIcon(iconKind);
    } 
} 
4
CodeRank
This code example shows how to use the following methods:getBeanDescriptor
 
    /** 
     * Obtain a group's display name 
     */ 
    private String groupDisplayName(String group) {
        ResourceBundle b = (ResourceBundle) beanInfo.getBeanDescriptor().getValue(RESOURCE_BUNDLE);
        if (b == null) {
            return group;
        } 
        String key = new StringBuilder(group).append(".displayName").toString();
        if (b.containsKey(key)) {
            return b.getString(key);
        } else { 
            return group;
        } 
    } 
 
    /** 
     * Comparator used to sort properties for presentation in the GUI. 
     */ 
4
CodeRank
This code example shows how to use the following methods:getIcon
	return beanDescriptor;
    } 
 
    public java.awt.Image getIcon(int iconKind) {
	if (targetBeanInfo != null) {
	    return targetBeanInfo.getIcon(iconKind);
	} 
	return super.getIcon(iconKind);
    } 
} 
4
CodeRank
See Code Examples for Java 8 BeanInfo Methods: