Java 类javafx.beans.property.adapter.JavaBeanStringProperty 实例源码

项目:photo-flow    文件:PhotoFlowController.java   
/**
 * @param bean
 * @param propertyName
 * @return {@link JavaBeanStringProperty}
 */
protected static JavaBeanStringProperty stringProperty(Object bean, String propertyName) {
    Object key = key(bean, propertyName);
    if (STRING_PROPERTIES.containsKey(key)) {
        return STRING_PROPERTIES.get(key);
    }
    try {
        JavaBeanStringProperty property = JavaBeanStringPropertyBuilder.create().bean(bean).name(propertyName).build();
        STRING_PROPERTIES.put(key, property);
        return property;
    } catch (NoSuchMethodException e) {
        throw new IllegalStateException(e);
    }
}
项目:lawless-legends    文件:PropertyHelper.java   
public static JavaBeanStringProperty stringProp(Object t, String fieldName) throws NoSuchMethodException {
    return new JavaBeanStringPropertyBuilder().bean(t).name(fieldName).build();
}