/** * @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); } }
public static JavaBeanStringProperty stringProp(Object t, String fieldName) throws NoSuchMethodException { return new JavaBeanStringPropertyBuilder().bean(t).name(fieldName).build(); }