本文整理汇总了Java中com.vaadin.data.PropertyDefinition类的典型用法代码示例。如果您正苦于以下问题:Java PropertyDefinition类的具体用法?Java PropertyDefinition怎么用?Java PropertyDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertyDefinition类属于com.vaadin.data包,在下文中一共展示了PropertyDefinition类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bind
import com.vaadin.data.PropertyDefinition; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public <PRESENTATION, MODEL> EasyBinding<BEAN, PRESENTATION, MODEL> bind(HasValue<PRESENTATION> field,
String propertyName, Converter<PRESENTATION, ?> converter, boolean readOnly) {
Objects.requireNonNull(converter);
Objects.requireNonNull(propertyName, "Property name cannot be null");
// checkUnbound();
PropertyDefinition<BEAN, ?> definition = propertySet.getProperty(propertyName)
.orElseThrow(() -> new IllegalArgumentException(
"Could not resolve property name " + propertyName + " from " + propertySet));
ValueProvider<BEAN, ?> getter = definition.getGetter();
Setter<BEAN, ?> setter = readOnly ? null : definition.getSetter().orElse(null);
EasyBinding<BEAN, PRESENTATION, MODEL> binding = bind(field, (ValueProvider) getter, (Setter) setter,
propertyName, (Converter) converter);
boundProperties.put(propertyName, binding);
Optional<Field> modelField = getDeclaredFieldByName(definition.getPropertyHolderType(), definition.getName());
if (Arrays.asList(modelField.get().getAnnotations()).stream().anyMatch(requiredConfigurator)) {
field.setRequiredIndicatorVisible(true);
}
return binding;
}
示例2: getPropertyDescriptor
import com.vaadin.data.PropertyDefinition; //导入依赖的package包/类
protected Optional<PropertyDefinition<BEAN, ?>> getPropertyDescriptor(Field field) {
PropertyId propertyIdAnnotation = field.getAnnotation(PropertyId.class);
String propertyId;
if (propertyIdAnnotation != null) {
// @PropertyId(propertyId) always overrides property id
propertyId = propertyIdAnnotation.value();
} else {
propertyId = field.getName();
}
return propertySet.getProperty(propertyId);
}
示例3: getProperty
import com.vaadin.data.PropertyDefinition; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Optional<PropertyDefinition<PropertyBox, ?>> getProperty(String name) {
if (name != null) {
return propertyDefinitions.entrySet().stream().filter(e -> name.equals(e.getValue().getName()))
.findFirst().map(d -> d.getValue());
}
return Optional.empty();
}
示例4: getProperty
import com.vaadin.data.PropertyDefinition; //导入依赖的package包/类
@Override
public Optional<PropertyDefinition<T, ?>> getProperty(String name) {
for (PropertyDefinition d : defList) {
if (d.getName().equals(name)) {
return Optional.of(d);
}
}
return Optional.empty();
}
示例5: getProperties
import com.vaadin.data.PropertyDefinition; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Stream<PropertyDefinition<PropertyBox, ?>> getProperties() {
return propertyDefinitions.entrySet().stream().map(e -> e.getValue());
}
示例6: getProperties
import com.vaadin.data.PropertyDefinition; //导入依赖的package包/类
@Override
public Stream<PropertyDefinition<T, ?>> getProperties() {
return defList.stream();
}